Title: inspect missing warnings import
Type: Stage:
Components: Library (Lib) Versions: Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, pnasrat, python-dev
Priority: normal Keywords:

Created on 2012-06-02 22:00 by pnasrat, last changed 2012-06-03 02:29 by brett.cannon. This issue is now closed.

Messages (2)
msg162184 - (view) Author: Paul Nasrat (pnasrat) Date: 2012-06-02 22:00
Whilst looking for workarounds to 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 "", 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/", 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/", line 202, in iter_modules
    modname = inspect.getmodulename(fn)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/", line 448, in getmodulename
    info = getmoduleinfo(path)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/", line 436, in getmoduleinfo
    warnings.warn('inspect.getmoduleinfo() is deprecated', DeprecationWarning,
NameError: global name 'warnings' is not defined
msg162188 - (view) Author: Roundup Robot (python-dev) Date: 2012-06-03 02:28
New changeset 3de5b053d924 by Brett Cannon in branch 'default':
Issue #14987: Add a missing import statement
Date User Action Args
2012-06-03 02:29:14brett.cannonsetstatus: open -> closed
assignee: brett.cannon
resolution: fixed
2012-06-03 02:28:51python-devsetnosy: + python-dev
messages: + msg162188
2012-06-02 22:56:42ned.deilysetnosy: + brett.cannon
2012-06-02 22:00:06pnasratcreate