diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 3 | ||||
-rwxr-xr-x | Lib/tkinter/Tkinter.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index cd341dd..13886eb 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 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 |