10000 Revert accidental changes and fix indentation · matplotlib/matplotlib@d75b068 · GitHub
[go: up one dir, main page]

Skip to content

Commit d75b068

Browse files
committed
Revert accidental changes and fix indentation
1 parent 12b0120 commit d75b068

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,7 @@ def __init__(self, filename, metadata=None):
483483
source_date = datetime.today()
484484

485485
self.infoDict = {
486-
'Creator': 'matplotlib ' + __version__ +
487-
', http://matplotlib.org',
486+
'Creator': 'matplotlib %s, http://matplotlib.org' % __version__,
488487
'Producer': 'matplotlib pdf backend%s' % revision,
489488
'CreationDate': source_date
490489
}

src/_png.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,27 +285,26 @@ static PyObject *Py_write_png(PyObject *self, PyObject *args, PyObject *kwds)
285285

286286
#ifdef PNG_TEXT_SUPPORTED
287287
// Save the metadata
288-
if (metadata != NULL)
289-
{
290-
meta_size = PyDict_Size(metadata);
291-
text = new png_text[meta_size];
288+
if (metadata != NULL) {
289+
meta_size = PyDict_Size(metadata);
290+
text = new png_text[meta_size];
292291

293-
while (PyDict_Next(metadata, &pos, &meta_key, &meta_val)) {
294-
text[meta_pos].compression = PNG_TEXT_COMPRESSION_NONE;
292+
while (PyDict_Next(metadata, &pos, &meta_key, &meta_val)) {
293+
text[meta_pos].compression = PNG_TEXT_COMPRESSION_NONE;
295294
#if PY3K
296-
text[meta_pos].key = PyBytes_AsString(meta_key);
297-
text[meta_pos].text = PyBytes_AsString(meta_val);
295+
text[meta_pos].key = PyBytes_AsString(meta_key);
296+
text[meta_pos].text = PyBytes_AsString(meta_val);
298297
#else
299-
text[meta_pos].key = PyString_AsString(meta_key);
300-
text[meta_pos].text = PyString_AsString(meta_val);
298+
text[meta_pos].key = PyString_AsString(meta_key);
299+
text[meta_pos].text = PyString_AsString(meta_val);
301300
#endif
302301
#ifdef PNG_iTXt_SUPPORTED
303-
text[meta_pos].lang = NULL;
302+
text[meta_pos].lang = NULL;
304303
#endif
305-
meta_pos++;
306-
}
307-
png_set_text(png_ptr, info_ptr, text, meta_size);
308-
delete[] text;
304+
meta_pos++;
305+
}
306+
png_set_text(png_ptr, info_ptr, text, meta_size);
307+
delete[] text;
309308
}
310309
#endif
311310

0 commit comments

Comments
 (0)
0