summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-10-12 00:54:14 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-10-12 00:54:14 (GMT)
commit6b4883dec0b7f6c5ede45dca861f5dc0e4ff2be7 (patch)
treee731290ba41ff9208385bebbe402282ecbbd682f /Python
parent983b1434bda1819864fb5d82248f249358a4c22d (diff)
downloadcpython-6b4883dec0b7f6c5ede45dca861f5dc0e4ff2be7.zip
cpython-6b4883dec0b7f6c5ede45dca861f5dc0e4ff2be7.tar.gz
cpython-6b4883dec0b7f6c5ede45dca861f5dc0e4ff2be7.tar.bz2
PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
Diffstat (limited to 'Python')
-rw-r--r--Python/errors.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 02f84b4..6e69d23 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -496,10 +496,11 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObject(
return NULL;
}
- if (filenameObject != NULL)
- v = Py_BuildValue("(iOO)", err, message, filenameObject);
- else
- v = Py_BuildValue("(iO)", err, message);
+ if (filenameObject == NULL)
+ filenameObject = Py_None;
+ /* This is the constructor signature for passing a Windows error code.
+ The POSIX translation will be figured out by the constructor. */
+ v = Py_BuildValue("(iOOi)", 0, message, filenameObject, err);
Py_DECREF(message);
if (v != NULL) {