[Python-Dev] regrtest.py mystery

Tim Peters tim.one@home.com
Mon, 17 Dec 2001 18:36:22 -0500


[/F]
> how do you detect that a module is successfully imported?
>
> the only way I can think of is "execution reached the end of
> the module", which would probably break considerable amounts
> of code that rely on "temporarily recursive" imports.

Presumably Greg's flag would be initialized to "not broken", and set to
"broken" when and only when an uncaught exception is raised.  So in

    import A
    A imports B
        which imports A
        back to B
        B completes
    back to A
    A blows up before completing

A's "broken" flag isn't set until the end, so B's recursive import of A
isn't harmed.