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

Skip to content

Commit 10515b6

Browse files
committed
main(): Move hackery of sys.argv until after the Tk instance has been
created. This allows the application-specific Tkinter initialization to be executed if present. Also pass an explicit className parameter to the Tk() constructor. This closes SourceForge bug #110618.
1 parent 81c1735 commit 10515b6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Tools/idle/PyShell.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,6 @@ def main():
712712
if o == '-t':
713713
PyShell.shell_title = a
714714

715-
if not edit:
716-
if cmd:
717-
sys.argv = ["-c"] + args
718-
else:
719-
sys.argv = args or [""]
720-
721715
for i in range(len(sys.path)):
722716
sys.path[i] = os.path.abspath(sys.path[i])
723717

@@ -735,14 +729,20 @@ def main():
735729
sys.path.insert(0, dir)
736730

737731
global flist, root
738-
root = Tk()
732+
root = Tk(className="Idle")
739733
fixwordbreaks(root)
740734
root.withdraw()
741735
flist = PyShellFileList(root)
742736

743737
if edit:
744738
for filename in args:
745739
flist.open(filename)
740+
else:
741+
if cmd:
742+
sys.argv = ["-c"] + args
743+
else:
744+
sys.argv = args or [""]
745+
746746

747747
shell = PyShell(flist)
748748
interp = shell.interp

0 commit comments

Comments
 (0)