A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-December/019011.html below:

[Python-Dev] regrtest.py mystery

[Python-Dev] regrtest.py mystery [Python-Dev] regrtest.py mysteryTim Peters tim.one@home.com
Mon, 17 Dec 2001 14:38:48 -0500
Without diving into the unloading pit, the endless problems with -r on
non-Unix boxes would go away if a module that failed to import didn't leave
behind a damaged module object in sys.modules ("damaged" == it may not
fulfill some or any of the module's contracts, and it's impossible to guess
which ones it won't, or to guess how the unfufilled ones may fail).

I'm tempted to add a pile of Windows-specific modules that import each other
in incestuous ways, so everyone can enjoy this chronic pain <wink>.

"A fix" seems to amount to treating

import M

as if it were

try:
    import M
except:
    if M in sys.modules:
        del sys.modules[M]
    raise

How would that hurt?




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4