Re: [Python-Dev] [Python-checkins] cpython (3.3): let's not return NULL from functions that should return ints

2013-07-22 Thread Benjamin Peterson
Yes, I meant to remove it. This function gnores errors in general.

2013/7/22 Eric V. Smith e...@trueblade.com:
 [re-sending to python-dev]

 On 7/21/2013 4:27 PM, benjamin.peterson wrote:

 @@ -267,7 +267,7 @@
  Py_DECREF(io);
  Py_DECREF(binary);
  PyMem_FREE(found_encoding);
 -return PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, 
 filename);
 +return 0;
  }
  fob = _PyObject_CallMethodId(io, PyId_TextIOWrapper, Os, binary, 
 encoding);
  Py_DECREF(io);

 Did you mean to remove the call to PyErr_SetFromErrnoWithFilenameObject?
 Or just call it, then ignore its return value and return 0?


 --
 Eric.
 ___
 Python-checkins mailing list
 python-check...@python.org
 http://mail.python.org/mailman/listinfo/python-checkins

 ___
 Python-Dev mailing list
 Python-Dev@python.org
 http://mail.python.org/mailman/listinfo/python-dev
 Unsubscribe: 
 http://mail.python.org/mailman/options/python-dev/benjamin%40python.org



-- 
Regards,
Benjamin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (3.3): let's not return NULL from functions that should return ints

2013-07-22 Thread Eric V. Smith
[re-sending to python-dev]

On 7/21/2013 4:27 PM, benjamin.peterson wrote:

 @@ -267,7 +267,7 @@
  Py_DECREF(io);
  Py_DECREF(binary);
  PyMem_FREE(found_encoding);
 -return PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, filename);
 +return 0;
  }
  fob = _PyObject_CallMethodId(io, PyId_TextIOWrapper, Os, binary, 
 encoding);
  Py_DECREF(io);

Did you mean to remove the call to PyErr_SetFromErrnoWithFilenameObject?
Or just call it, then ignore its return value and return 0?


-- 
Eric.
___
Python-checkins mailing list
python-check...@python.org
http://mail.python.org/mailman/listinfo/python-checkins

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com