[New-bugs-announce] [issue25142] Misleading error when initing ImportError

Sebastian Kreft report at bugs.python.org
Wed Sep 16 16:48:47 CEST 2015


New submission from Sebastian Kreft:

ImportError now supports the keyword arguments name and path. However, when passing invalid keyword arguments, the reported error is misleading, as shown below.

In [1]: ImportError('lib', name='lib')
Out[1]: ImportError('lib')

In [2]: ImportError('lib', name='lib', foo='foo')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-5af12651187f> in <module>()
----> 1 ImportError('lib', name='lib', foo='foo')

TypeError: ImportError does not take keyword arguments

----------
messages: 250850
nosy: Sebastian Kreft
priority: normal
severity: normal
status: open
title: Misleading error when initing ImportError
versions: Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25142>
_______________________________________


More information about the New-bugs-announce mailing list