(Tkinter.py): Improve application basename determination to make .py and

.pyc extensions completely equivelent when locating the "profile"
	which should be read on startup.
This commit is contained in:
Fred Drake 1996-10-06 17:55:20 +00:00
parent 4be63d1725
commit cab3c3b8d4
2 changed files with 4 additions and 2 deletions

View File

@ -638,7 +638,8 @@ class Tk(Misc, Wm):
if baseName is None:
import sys, os
baseName = os.path.basename(sys.argv[0])
if baseName[-3:] == '.py': baseName = baseName[:-3]
baseName, ext = os.path.splitext(baseName)
if ext not in ('.py', 'pyc'): baseName = baseName + ext
self.tk = tkinter.create(screenName, baseName, className)
try:
# Disable event scanning except for Command-Period

View File

@ -638,7 +638,8 @@ class Tk(Misc, Wm):
if baseName is None:
import sys, os
baseName = os.path.basename(sys.argv[0])
if baseName[-3:] == '.py': baseName = baseName[:-3]
baseName, ext = os.path.splitext(baseName)
if ext not in ('.py', 'pyc'): baseName = baseName + ext
self.tk = tkinter.create(screenName, baseName, className)
try:
# Disable event scanning except for Command-Period