[issue10854] Output .pyd name in error message of ImportError when DLL load fails

Kristján Valur Jónsson report at bugs.python.org
Sun Jul 22 13:28:32 CEST 2012


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

An example patch that aims to put the "name" and "path" in str() and repr() representations of ImportError.

Output when _socket.pyd is not found:

>>> import socket
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\pydev\hg\cpython3\lib\socket.py", line 47, in <module>
    import _socket
ImportError: No module named '_socket', _socket,
>>> sys.last_value
<ImportError "No module named '_socket'", '_socket', None>
>>>

----------
Added file: http://bugs.python.org/file26476/ImportError.patch

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


More information about the Python-bugs-list mailing list