8000 Show warnings once · python/cpython@a20cf7c · GitHub
[go: up one dir, main page]

Skip to content

Commit a20cf7c

Browse files
authored
Show warnings once
1 parent b2ebe5c commit a20cf7c

File tree

1 file changed

+3
-1< 8000 /div>lines changed

1 file changed

+3
-1
lines changed

Lib/idlelib/pyshell.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ def runsource(self, source):
684684
# self.write("Unsupported characters in input\n")
685685
# return
686686
# II.runsource() calls .runcode(), overridden below.
687-
return InteractiveInterpreter.runsource(self, source, filename)
687+
with warnings.catch_warnings():
688+
warnings.filterwarnings('once')
689+
return InteractiveInterpreter.runsource(self, source, filename)
688690

689691
def stuffsource(self, source):
690692
"Stuff source in the filename cache"

0 commit comments

Comments
 (0)
0