summaryrefslogtreecommitdiff
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authordoko@ubuntu.com <doko@ubuntu.com>2012-07-01 00:38:34 +0200
committerdoko@ubuntu.com <doko@ubuntu.com>2012-07-01 00:38:34 +0200
commit41f9d04e0661a3e6e8f8045497972e153f77af16 (patch)
treec044d28c9f0e6808e2efbdbc18a5952421962688 /Objects/exceptions.c
parent49a7da30aa823e634d2c7223d37ef93592304876 (diff)
parentf87289bb58e71f5df73cbd594cbc0c0515e91c4b (diff)
downloadcpython-git-41f9d04e0661a3e6e8f8045497972e153f77af16.tar.gz
null merge
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index f706698499..5c85f10444 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -834,6 +834,7 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args,
#endif
/* Steals the reference to args */
+ Py_CLEAR(self->args);
self->args = args;
args = NULL;
@@ -916,6 +917,11 @@ OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
))
goto error;
}
+ else {
+ self->args = PyTuple_New(0);
+ if (self->args == NULL)
+ goto error;
+ }
return (PyObject *) self;