In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >I'm using some legacy code that has a user-defined exception in it. > >The top level program includes this line > >from TestRunError import * > >It also imports several other modules. These other modules do not >explicitly import TestRunError. TestRunError is raised in various >places throughout the modules.
The import line imports TestRunError into the "global" namespeace of the top level program module *only*. It is not magically propogated to the other modules imported -- if they want to use TestRunError themselves, they have to import it, otherwise this happens: >FATAL ERROR: global name 'TestRunError' is not defined >I realize this is kind of a silly question to ask in the general sense >without showing more of the code, but does anyone have any suggestions >as to the most likely causes of this error coming up? The cause is whoever wrote the legacy code not understanding how to program in Python. -- \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/ "Frankly I have no feelings towards penguins one way or the other" -- Arthur C. Clarke her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
-- http://mail.python.org/mailman/listinfo/python-list