summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-30 09:03:45 (GMT)
committerGeorg Brandl <georg@python.org>2006-09-30 09:03:45 (GMT)
commit506cc189a97a468180ee18e4c4cd1b4e81242222 (patch)
treed89db2831faf617dba4844248d5cd75f6c40241d /Objects/exceptions.c
parentaf4337a0173d8ae9117b3c82c814ab2b9e635b35 (diff)
downloadcpython-506cc189a97a468180ee18e4c4cd1b4e81242222.zip
cpython-506cc189a97a468180ee18e4c4cd1b4e81242222.tar.gz
cpython-506cc189a97a468180ee18e4c4cd1b4e81242222.tar.bz2
Bug #1566800: make sure that EnvironmentError can be called with any
number of arguments, as was the case in Python 2.4. (backport from rev. 52061)
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index bfe28a9..c0b813d 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -510,7 +510,7 @@ EnvironmentError_init(PyEnvironmentErrorObject *self, PyObject *args,
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
return -1;
- if (PyTuple_GET_SIZE(args) <= 1) {
+ if (PyTuple_GET_SIZE(args) <= 1 || PyTuple_GET_SIZE(args) > 3) {
return 0;
}