File tree 1 file changed +5
-12
lines changed
1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -161,19 +161,12 @@ def load_wsgi(self):
161
161
162
162
self .log .exception (e )
163
163
164
- # fix from PR #1228
165
- # storing the traceback into exc_tb will create a circular reference.
166
- # per https://docs.python.org/2/library/sys.html#sys.exc_info warning,
167
- # delete the traceback after use.
168
- try :
169
- _ , exc_val , exc_tb = sys .exc_info ()
170
- self .reloader .add_extra_file (exc_val .filename )
171
-
172
- tb_string = io .StringIO ()
173
- traceback .print_tb (exc_tb , file = tb_string )
164
+ if self .reloader is not None :
165
+ self .reloader .add_extra_file (e .filename )
166
+
167
+ with io .StringIO () as tb_string :
168
+ traceback .print_tb (e .__traceback__ , file = tb_string )
174
169
self .wsgi = util .make_fail_app (tb_string .getvalue ())
175
- finally :
176
- del exc_tb
177
170
178
171
def init_signals (self ):
179
172
# reset signaling
You can’t perform that action at this time.
0 commit comments