From: Fred Drake Date: Sun, 6 Oct 1996 17:55:20 +0000 (+0000) Subject: (Tkinter.py): Improve application basename determination to make .py and X-Git-Tag: v1.4~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cab3c3b8d4e376d5d8f4d23b0e805397d359f206;p=thirdparty%2FPython%2Fcpython.git (Tkinter.py): Improve application basename determination to make .py and .pyc extensions completely equivelent when locating the "profile" which should be read on startup. --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index cd341dd165b6..13886eb21a42 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/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 diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index cd341dd165b6..13886eb21a42 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