Skip to content
Myr

Added a comment on who the is_important_traceback seems to work. It's only speculation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 9a70e62 · Browse files · 1 file+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−0 removed

  • other:+14 added−0 removed

1 file+14 added−0 removed

modified:flask/ext/__init__.py+14 added
71 unmodified lines
72 then we were able to import the module itself but apparently73 something went wrong when the module was imported. (Eg: import74 of an import failed).75 """76 # Why can we access f_globals' __name__ here and the value is77 # not None? I honestly don't know but here is my thinking.78 # The module owns a reference to globals and the frame has one.79 # Each function only keeps a reference to the globals not do the80 # module which normally causes the problem that when the module81 # shuts down all globals are set to None. Now however when the82 # import system fails Python takes the short way out and does not83 # actually properly shut down the module by Noneing the values84 # but by just removing the entry from sys.modules. This means85 # that the regular reference based cleanup kicks in.86 #87 # The good thing: At worst we will swallow an exception we should88 # not and the error message will be messed up. However I think89 # this should be sufficiently reliable.90 while tb is not None:91 if tb.tb_frame.f_globals.get('__name__') == important_module:92 return True93 tb = tb.tb_next
5 unmodified lines