Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff1d5ab

Browse files
committed
Issue #25507: IDLE no longer runs buggy code because of its tkinter imports.
Users must include the same imports required to run directly in Python.
1 parent 7ca63cb commit ff1d5ab

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/idlelib/run.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919

2020
import __main__
2121

22+
for mod in ('simpledialog', 'messagebox', 'font',
23+
'dialog', 'filedialog', 'commondialog',
24+
'colorchooser'):
25+
delattr(tkinter, mod)
26+
del sys.modules['tkinter.' + mod]
27+
2228
LOCALHOST = '127.0.0.1'
2329

2430
import warnings

0 commit comments

Comments
 (0)