Author serhiy.storchaka
Recipients brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
Date 2018-10-20.07:52:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540021933.73.0.788709270274.issue33237@psf.upfronthosting.co.za>
In-reply-to
Content
Example:

$ cat foo.py
import bar
bar.baz
$ cat bar.py
import foo
baz = 2
$ ./python foo.py 
Traceback (most recent call last):
  File "foo.py", line 1, in <module>
    import bar
  File "/home/serhiy/py/cpython/bar.py", line 1, in <module>
    import foo
  File "/home/serhiy/py/cpython/foo.py", line 2, in <module>
    bar.baz
AttributeError: module 'bar' has no attribute 'baz'

Patched:

$ ./python foo.py 
Traceback (most recent call last):
  File "foo.py", line 1, in <module>
    import bar
  File "/home/serhiy/py/cpython/bar.py", line 1, in <module>
    import foo
  File "/home/serhiy/py/cpython/foo.py", line 2, in <module>
    bar.baz
AttributeError: partially initialized module 'bar' has no attribute 'baz' (most likely due to a circular import)
History
Date User Action Args
2018-10-20 07:52:13serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, ncoghlan, eric.snow
2018-10-20 07:52:13serhiy.storchakasetmessageid: <1540021933.73.0.788709270274.issue33237@psf.upfronthosting.co.za>
2018-10-20 07:52:13serhiy.storchakalinkissue33237 messages
2018-10-20 07:52:13serhiy.storchakacreate