New submission from Xiang Zhang:

ImportError accepts name and path as keyword-only parameters, but when invalid 
keyword argument passed, it emits wrong exception message saying that 
ImportError does not take keyword arguments.

>>> ImportError(name='name', path='path')
ImportError()
>>> ImportError(foo=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: ImportError does not take keyword arguments

Propose a patch to fix this. Hope it helps.

----------
components: Interpreter Core
files: ImportError_constructor_exception.patch
keywords: patch
messages: 271991
nosy: brett.cannon, xiang.zhang
priority: normal
severity: normal
status: open
title: Incorrect exception message of ImportError constructor
versions: Python 3.6
Added file: 
http://bugs.python.org/file44009/ImportError_constructor_exception.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27684>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to