mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix for issue 8476
This commit is contained in:
parent
c4ae73e5f7
commit
5d18cc6b46
1 changed files with 5 additions and 4 deletions
|
@ -1099,13 +1099,14 @@ def setIcon(filePath, icnsPath):
|
||||||
Set the custom icon for the specified file or directory.
|
Set the custom icon for the specified file or directory.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
toolPath = os.path.join(os.path.dirname(__file__), "seticon.app/Contents/MacOS/seticon")
|
dirPath = os.path.normpath(os.path.dirname(__file__))
|
||||||
dirPath = os.path.dirname(__file__)
|
toolPath = os.path.join(dirPath, "seticon.app/Contents/MacOS/seticon")
|
||||||
if not os.path.exists(toolPath) or os.stat(toolPath).st_mtime < os.stat(dirPath + '/seticon.m').st_mtime:
|
if not os.path.exists(toolPath) or os.stat(toolPath).st_mtime < os.stat(dirPath + '/seticon.m').st_mtime:
|
||||||
# NOTE: The tool is created inside an .app bundle, otherwise it won't work due
|
# NOTE: The tool is created inside an .app bundle, otherwise it won't work due
|
||||||
# to connections to the window server.
|
# to connections to the window server.
|
||||||
if not os.path.exists('seticon.app/Contents/MacOS'):
|
appPath = os.path.join(dirPath, "seticon.app/Contents/MacOS")
|
||||||
os.makedirs('seticon.app/Contents/MacOS')
|
if not os.path.exists(appPath):
|
||||||
|
os.makedirs(appPath)
|
||||||
runCommand("cc -o %s %s/seticon.m -framework Cocoa"%(
|
runCommand("cc -o %s %s/seticon.m -framework Cocoa"%(
|
||||||
shellQuote(toolPath), shellQuote(dirPath)))
|
shellQuote(toolPath), shellQuote(dirPath)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue