]> granicus.if.org Git - python/commitdiff
main(): Move hackery of sys.argv until after the Tk instance has been
authorFred Drake <fdrake@acm.org>
Fri, 15 Sep 2000 04:32:56 +0000 (04:32 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 15 Sep 2000 04:32:56 +0000 (04:32 +0000)
         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.

Tools/idle/PyShell.py

index 0bdb05907fd08b6f9580f7731fecab08e900ba32..06d4f151215f3d8ae13b1e20fc18d6802c4626f1 100644 (file)
@@ -712,12 +712,6 @@ def main():
         if o == '-t':
             PyShell.shell_title = a
 
-    if not edit:
-        if cmd:
-            sys.argv = ["-c"] + args
-        else:
-            sys.argv = args or [""]
-
     for i in range(len(sys.path)):
         sys.path[i] = os.path.abspath(sys.path[i])
 
@@ -735,7 +729,7 @@ def main():
             sys.path.insert(0, dir)
 
     global flist, root
-    root = Tk()
+    root = Tk(className="Idle")
     fixwordbreaks(root)
     root.withdraw()
     flist = PyShellFileList(root)
@@ -743,6 +737,12 @@ def main():
     if edit:
         for filename in args:
             flist.open(filename)
+    else:
+        if cmd:
+            sys.argv = ["-c"] + args
+        else:
+            sys.argv = args or [""]
+
 
     shell = PyShell(flist)
     interp = shell.interp