Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clear exceptions if PyFile_Dup() fails -- we have a way to handle "no…

…n-real" file objects.
  • Loading branch information...
commit cd6c8c932ea3fc768b145a9ad053bf05b2f1b62d 1 parent 889951e
@mdboom authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/_png.cpp
View
2  src/_png.cpp
@@ -149,6 +149,7 @@ Py::Object _png_module::write_png(const Py::Tuple& args)
}
else
{
+ PyErr_Clear();
PyObject* write_method = PyObject_GetAttrString(
py_file, "write");
if (!(write_method && PyCallable_Check(write_method)))
@@ -326,6 +327,7 @@ _png_module::_read_png(const Py::Object& py_fileobj, const bool float_result,
}
else
{
+ PyErr_Clear();
PyObject* read_method = PyObject_GetAttrString(py_file, "read");
if (!(read_method && PyCallable_Check(read_method)))
{
Please sign in to comment.
Something went wrong with that request. Please try again.