Skip to content

Commit c66bec5

Browse files
Issue #281: App won't launch on macOS 10.9 or 10.10
1 parent 8ca33e3 commit c66bec5

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

doc/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ py2app 0.22
1212
* #299: Fix build error when building with the copy of Python 3 shipped
1313
with Xcode.
1414

15+
* #281: Generated bundle doesn't work on macOS 10.9 and 10.10.
16+
1517
py2app 0.21
1618
-----------
1719

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
import sys
2-
32
import py2app
43

54
__all__ = ["infoPlistDict"]
65

76

8-
def infoPlistDict(CFBundleExecutable, plist=None):
9-
if plist is None:
10-
plist = {}
11-
7+
def infoPlistDict(CFBundleExecutable, plist={}):
128
CFBundleExecutable = CFBundleExecutable
139
version = sys.version[:3]
14-
pdict = {
15-
"CFBundleDevelopmentRegion": "English",
16-
"CFBundleDisplayName": plist.get("CFBundleName", CFBundleExecutable),
17-
"CFBundleExecutable": CFBundleExecutable,
18-
"CFBundleIconFile": CFBundleExecutable,
19-
"CFBundleIdentifier": "org.pythonmac.unspecified.%s"
10+
pdict = dict(
11+
CFBundleDevelopmentRegion="English",
12+
CFBundleDisplayName=plist.get("CFBundleName", CFBundleExecutable),
13+
CFBundleExecutable=CFBundleExecutable,
14+
CFBundleIconFile=CFBundleExecutable,
15+
CFBundleIdentifier="org.pythonmac.unspecified.%s"
2016
% ("".join(CFBundleExecutable.split()),),
21-
"CFBundleInfoDictionaryVersion": "6.0",
22-
"CFBundleName": CFBundleExecutable,
23-
"CFBundlePackageType": "APPL",
24-
"CFBundleShortVersionString": plist.get("CFBundleVersion", "0.0"),
25-
"CFBundleSignature": "????",
26-
"CFBundleVersion": "0.0",
27-
"LSHasLocalizedDisplayName": False,
28-
"NSAppleScriptEnabled": False,
29-
"NSHumanReadableCopyright": "Copyright not specified",
30-
"NSMainNibFile=": "MainMenu",
31-
"NSPrincipalClass": "NSApplication",
32-
"PyMainFileNames": ["__boot__"],
33-
"PyResourcePackages": [],
34-
"PyRuntimeLocations": [
17+
CFBundleInfoDictionaryVersion="6.0",
18+
CFBundleName=CFBundleExecutable,
19+
CFBundlePackageType="APPL",
20+
CFBundleShortVersionString=plist.get("CFBundleVersion", "0.0"),
21+
CFBundleSignature="????",
22+
CFBundleVersion="0.0",
23+
LSHasLocalizedDisplayName=False,
24+
NSAppleScriptEnabled=False,
25+
NSHumanReadableCopyright="Copyright not specified",
26+
NSMainNibFile="MainMenu",
27+
NSPrincipalClass="NSApplication",
28+
PyMainFileNames=["__boot__"],
29+
PyResourcePackages=[],
30+
PyRuntimeLocations=[
3531
(s % version)
3632
for s in [
3733
(
@@ -44,16 +40,21 @@ def infoPlistDict(CFBundleExecutable, plist=None):
4440
"/System/Library/Frameworks/Python.framework/Versions/%s/Python",
4541
]
4642
],
47-
}
43+
)
4844
pdict.update(plist)
4945
pythonInfo = pdict.setdefault("PythonInfoDict", {})
5046
pythonInfo.update(
51-
{
52-
"PythonLongVersion": sys.version,
53-
"PythonShortVersion": sys.version[:3],
54-
"PythonExecutable": sys.executable,
55-
}
47+
dict(
48+
PythonLongVersion=sys.version,
49+
PythonShortVersion=sys.version[:3],
50+
PythonExecutable=sys.executable,
51+
)
5652
)
5753
py2appInfo = pythonInfo.setdefault("py2app", {})
58-
py2appInfo.update({"version": py2app.__version__, "template": "app"})
54+
py2appInfo.update(
55+
dict(
56+
version=py2app.__version__,
57+
template="app",
58+
)
59+
)
5960
return pdict

0 commit comments

Comments
 (0)