Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7dc06fb

Browse files
committed
Use 'y#' instead of 's#' in write_rgba of the agg backend. Fixes matplotlib#1891.
1 parent 7feeb0e commit 7dc06fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/_backend_agg.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,11 @@ RendererAgg::write_rgba(const Py::Tuple& args)
21772177
"Object does not appear to be a 8-bit string path or a Python file-like object");
21782178
}
21792179

2180+
#if PY3K
2181+
PyObject_CallFunction(write_method, (char *)"y#", pixBuffer, NUMBYTES);
2182+
#else
21802183
PyObject_CallFunction(write_method, (char *)"s#", pixBuffer, NUMBYTES);
2184+
#endif
21812185

21822186
Py_XDECREF(write_method);
21832187
}

0 commit comments

Comments
 (0)