mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
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.
This commit is contained in:
parent
81c1735809
commit
10515b6483
1 changed files with 7 additions and 7 deletions
|
@ -712,12 +712,6 @@ def main():
|
||||||
if o == '-t':
|
if o == '-t':
|
||||||
PyShell.shell_title = a
|
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)):
|
for i in range(len(sys.path)):
|
||||||
sys.path[i] = os.path.abspath(sys.path[i])
|
sys.path[i] = os.path.abspath(sys.path[i])
|
||||||
|
|
||||||
|
@ -735,7 +729,7 @@ def main():
|
||||||
sys.path.insert(0, dir)
|
sys.path.insert(0, dir)
|
||||||
|
|
||||||
global flist, root
|
global flist, root
|
||||||
root = Tk()
|
root = Tk(className="Idle")
|
||||||
fixwordbreaks(root)
|
fixwordbreaks(root)
|
||||||
root.withdraw()
|
root.withdraw()
|
||||||
flist = PyShellFileList(root)
|
flist = PyShellFileList(root)
|
||||||
|
@ -743,6 +737,12 @@ def main():
|
||||||
if edit:
|
if edit:
|
||||||
for filename in args:
|
for filename in args:
|
||||||
flist.open(filename)
|
flist.open(filename)
|
||||||
|
else:
|
||||||
|
if cmd:
|
||||||
|
sys.argv = ["-c"] + args
|
||||||
|
else:
|
||||||
|
sys.argv = args or [""]
|
||||||
|
|
||||||
|
|
||||||
shell = PyShell(flist)
|
shell = PyShell(flist)
|
||||||
interp = shell.interp
|
interp = shell.interp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue