[Python-Dev] regrtest.py mystery
Greg Ewing
greg@cosc.canterbury.ac.nz
Tue, 18 Dec 2001 12:23:53 +1300 (NZDT)
Fredrik Lundh <fredrik@pythonware.com>:
> 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.
If an exception propagates back through an import
statement, the module that it's importing is marked as
broken.
This may result in a single error causing more than one
module to be marked as broken, but I think that's the right
thing to do anyway. E.g. if you import module A which imports
module B which fails, you can't be sure that either A or B
is fit to use, so both should be marked as broken.
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg@cosc.canterbury.ac.nz +--------------------------------------+