summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1996-10-06 17:55:20 (GMT)
committerFred Drake <fdrake@acm.org>1996-10-06 17:55:20 (GMT)
commitcab3c3b8d4e376d5d8f4d23b0e805397d359f206 (patch)
tree80204b21a1e87b6b4deb1d5991f6fb0a342fcf16 /Lib/tkinter
parent4be63d17255b590bad8d80b564a717995f2ee3f3 (diff)
downloadcpython-cab3c3b8d4e376d5d8f4d23b0e805397d359f206.zip
cpython-cab3c3b8d4e376d5d8f4d23b0e805397d359f206.tar.gz
cpython-cab3c3b8d4e376d5d8f4d23b0e805397d359f206.tar.bz2
(Tkinter.py): Improve application basename determination to make .py and
.pyc extensions completely equivelent when locating the "profile" which should be read on startup.
Diffstat (limited to 'Lib/tkinter')
-rwxr-xr-xLib/tkinter/Tkinter.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py
index cd341dd..13886eb 100755
--- a/Lib/tkinter/Tkinter.py
+++ b/Lib/tkinter/Tkinter.py
@@ -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