@@ -394,7 +394,6 @@ def __init__(self, tkconsole):
394
394
self .tkconsole = tkconsole
395
395
locals = sys .modules ['__main__' ].__dict__
396
396
InteractiveInterpreter .__init__ (self , locals = locals )
397
- self .save_warnings_filters = None
398
397
self .restarting = False
399
398
self .subprocess_arglist = None
400
399
self .port = PORT
@@ -665,8 +664,6 @@ def runsource(self, source):
665
664
"Extend base class method: Stuff the source in the line cache first"
666
665
filename = self .stuffsource (source )
667
666
self .more = 0
668
- self .save_warnings_filters = warnings .filters [:]
669
- warnings .filterwarnings (action = "error" , category = SyntaxWarning )
670
667
# at the moment, InteractiveInterpreter expects str
671
668
assert isinstance (source , str )
672
669
#if isinstance(source, str):
@@ -677,14 +674,9 @@ def runsource(self, source):
677
674
# self.tkconsole.resetoutput()
678
675
# self.write("Unsupported characters in input\n")
679
676
# return
680
- try :
681
- # InteractiveInterpreter.runsource() calls its runcode() method,
682
- # which is overridden (see below)
683
- return InteractiveInterpreter .runsource (self , source , filename )
684
- finally :
685
- if self .save_warnings_filters is not None :
686
- warnings .filters [:] = self .save_warnings_filters
687
- self .save_warnings_filters = None
677
+ # InteractiveInterpreter.runsource() calls its runcode() method,
678
+ # which is overridden (see below)
679
+ return InteractiveInterpreter .runsource (self , source , filename )
688
680
689
681
def stuffsource (self , source ):
690
682
"Stuff source in the filename cache"
@@ -763,9 +755,6 @@ def runcode(self, code):
763
755
if self .tkconsole .executing :
764
756
self .interp .restart_subprocess ()
765
757
self .checklinecache ()
766
- if self .save_warnings_filters is not None :
767
- warnings .filters [:] = self .save_warnings_filters
768
- self .save_warnings_filters = None
769
758
debugger = self .debugger
770
759
try :
771
760
self .tkconsole .beginexecuting ()
0 commit comments