mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
(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:
parent
4be63d1725
commit
cab3c3b8d4
2 changed files with 4 additions and 2 deletions
|
@ -638,7 +638,8 @@ class Tk(Misc, Wm):
|
||||||
if baseName is None:
|
if baseName is None:
|
||||||
import sys, os
|
import sys, os
|
||||||
baseName = os.path.basename(sys.argv[0])
|
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)
|
self.tk = tkinter.create(screenName, baseName, className)
|
||||||
try:
|
try:
|
||||||
# Disable event scanning except for Command-Period
|
# Disable event scanning except for Command-Period
|
||||||
|
|
|
@ -638,7 +638,8 @@ class Tk(Misc, Wm):
|
||||||
if baseName is None:
|
if baseName is None:
|
||||||
import sys, os
|
import sys, os
|
||||||
baseName = os.path.basename(sys.argv[0])
|
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)
|
self.tk = tkinter.create(screenName, baseName, className)
|
||||||
try:
|
try:
|
||||||
# Disable event scanning except for Command-Period
|
# Disable event scanning except for Command-Period
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue