Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cd6c8c9

Browse filesBrowse files
committed
Clear exceptions if PyFile_Dup() fails -- we have a way to handle "non-real" file objects.
1 parent 889951e commit cd6c8c9
Copy full SHA for cd6c8c9

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed

‎src/_png.cpp

Copy file name to clipboardExpand all lines: src/_png.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ Py::Object _png_module::write_png(const Py::Tuple& args)
149149
}
150150
else
151151
{
152+
PyErr_Clear();
152153
PyObject* write_method = PyObject_GetAttrString(
153154
py_file, "write");
154155
if (!(write_method && PyCallable_Check(write_method)))
@@ -326,6 +327,7 @@ _png_module::_read_png(const Py::Object& py_fileobj, const bool float_result,
326327
}
327328
else
328329
{
330+
PyErr_Clear();
329331
PyObject* read_method = PyObject_GetAttrString(py_file, "read");
330332
if (!(read_method && PyCallable_Check(read_method)))
331333
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.