This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients Calvin.Spealman, eric.snow, r.david.murray
Date 2011-07-14.01:28:57
SpamBayes Score 6.4122037e-07
Marked as misclassified No
Message-id <1310606938.7.0.203712329856.issue12554@psf.upfronthosting.co.za>
In-reply-to
Content
In fact, to hopefully make perfectly clear what is going on here, let me demonstrate that *any* executable statement in the module that fails to load is executed if it occurs before the error that causes the load failure:

    rdmurray@hey:~/python/p32>cat temp.py
    import os

    print('foo:', hasattr(os, 'foo'))

    try:
        import temp2
    except AttributeError:
        print('attribute error')

    print('temp2:', 'temp2' in globals())
    print('foo:', hasattr(os, 'foo'))
    rdmurray@hey:~/python/p32>cat temp2.py
    import os

    os.foo = 2
    os.bar

    rdmurray@hey:~/python/p32>./python temp.py
    foo: False
    attribute error
    temp2: False
    foo: True
History
Date User Action Args
2011-07-14 01:28:58r.david.murraysetrecipients: + r.david.murray, Calvin.Spealman, eric.snow
2011-07-14 01:28:58r.david.murraysetmessageid: <1310606938.7.0.203712329856.issue12554@psf.upfronthosting.co.za>
2011-07-14 01:28:57r.david.murraylinkissue12554 messages
2011-07-14 01:28:57r.david.murraycreate