Ticket #6298: reflect-6298.patch

File reflect-6298.patch, 1.1 KB (added by thijs, 3 years ago)
  • twisted/python/_reflectpy3.py

     
    194194    administrative error (entering the wrong module name), from programmer
    195195    error (writing buggy code in a module that fails to import).
    196196
     197    @param importName: The name of the module to import.
     198    @type importName: L{str}
    197199    @raise Exception: if something bad happens.  This can be any type of
    198200    exception, since nobody knows what loading some arbitrary code might do.
    199 
    200201    @raise _NoModuleFound: if no module was found.
    201202    """
    202203    try:
     
    205206        excType, excValue, excTraceback = sys.exc_info()
    206207        while excTraceback:
    207208            execName = excTraceback.tb_frame.f_globals["__name__"]
    208             if execName is None:
     209            if execName is None or execName == importName:
    209210                reraise(excValue, excTraceback)
    210211            excTraceback = excTraceback.tb_next
    211212        raise _NoModuleFound()