Issue 11502: assignment of winreg module to another name causes NameError

Created on 2011-03-14 16:31 by jaraco, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg130849 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2011-03-14 16:31
Consider the Python file:

    import _winreg
    _winreg.foo
    x = _winreg

Currently, 2to3 converts this to:

    import winreg
    winreg.foo
    x = _winreg

The result will elicit a NameError on line 3 (if line 2 is valid). Is it possible to support this case?
msg130910 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2011-03-14 21:38
It's a duplicate of issue #11276.
msg130913 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2011-03-14 21:51
Good call. Closing.
History
Date User Action Args
2022-04-11 14:57:14adminsetgithub: 55711
2011-03-14 21:51:34jaracosetstatus: open -> closed

messages: + msg130913
resolution: duplicate

2011-03-14 21:38:13Arfreversetnosy: + Arfrever
messages: + msg130910
2011-03-14 16:31:31jaracocreate