[New-bugs-announce] [issue14987] inspect missing warnings import

Paul Nasrat report at bugs.python.org
Sun Jun 3 00:00:07 CEST 2012


New submission from Paul Nasrat <pnasrat at gmail.com>:

Whilst looking for workarounds to http://bugs.python.org/issue14982 I came across this, which is due to inspect using warnings without having importing it.

Fix is trivial but can upload a patch

Traceback (most recent call last):
  File "t.py", line 7, in <module>
    print(list(iter_modules(path=vcs.__path__, prefix=vcs.__name__+'.')))
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/pkgutil.py", line 144, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/pkgutil.py", line 202, in iter_modules
    modname = inspect.getmodulename(fn)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py", line 448, in getmodulename
    info = getmoduleinfo(path)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py", line 436, in getmoduleinfo
    warnings.warn('inspect.getmoduleinfo() is deprecated', DeprecationWarning,
NameError: global name 'warnings' is not defined

----------
components: Library (Lib)
messages: 162184
nosy: pnasrat
priority: normal
severity: normal
status: open
title: inspect missing warnings import
versions: Python 3.3

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


More information about the New-bugs-announce mailing list