Bug #1566800: make sure that EnvironmentError can be called with any

number of arguments, as was the case in Python 2.4.
This commit is contained in:
Georg Brandl 2006-09-30 09:03:42 +00:00
parent 5d59c09834
commit 3267d28f9d
3 changed files with 12 additions and 4 deletions

View file

@ -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;
}