cpython: 59268ac85f4e (original) (raw)

Mercurial > cpython

changeset 104105:59268ac85f4e

Issue #21578: Fixed misleading error message when ImportError called with invalid keyword args. [#21578]

Serhiy Storchaka storchaka@gmail.com
date Tue, 27 Sep 2016 20:51:27 +0300
parents 6117d0e1a5c9(current diff)95549f4970d0(diff)
children 675d3f76444d
files Misc/NEWS
diffstat 3 files changed, 45 insertions(+), 24 deletions(-)[+] [-] Lib/test/test_exceptions.py 16 Misc/NEWS 3 Objects/exceptions.c 50

line wrap: on

line diff

--- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -1096,6 +1096,22 @@ class ImportErrorTests(unittest.TestCase self.assertEqual(exc.name, 'somename') self.assertEqual(exc.path, 'somepath')

+

+

+

+

+ def test_non_str_argument(self): # Issue #15778 with check_warnings(('', BytesWarning), quiet=True):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1 Core and Builtins ----------------- +- Issue #21578: Fixed misleading error message when ImportError called with

--- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -612,36 +612,38 @@ SimpleExtendsException(PyExc_BaseExcepti static int ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds) {

+

+

-

return 0; }