diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-12 02:54:14 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-12 02:54:14 +0200 |
commit | f52a051081e30c3421e009d1369e4f6be081fd93 (patch) | |
tree | 59dcff250ede84649502dc01e2253703cde35ce2 /Python/errors.c | |
parent | 88e5428c53071d947210f4fe0e5ddc4dc06a9021 (diff) | |
download | cpython-f52a051081e30c3421e009d1369e4f6be081fd93.tar.gz |
PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/errors.c b/Python/errors.c index 02f84b46ac..6e69d23c30 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) { |