Skip to content

Commit c76473d

Browse files
committed
Fix Mac build, patch #1091 by Humberto Diogenes.
1 parent e4ac750 commit c76473d

8 files changed

Lines changed: 18 additions & 16 deletions

File tree

Lib/plat-mac/Carbon/ControlAccessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Accessor functions for control properties
22

3-
from Controls import *
3+
from Carbon.Controls import *
44
import struct
55

66
# These needn't go through this module, but are here for completeness

Lib/plat-mac/buildtools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
warnings.warn("the buildtools module is deprecated", DeprecationWarning, 2)
1818

1919

20-
BuildError = "BuildError"
20+
class BuildError(Exception):
21+
pass
2122

2223
# .pyc file (and 'PYC ' resource magic number)
2324
MAGIC = imp.get_magic()

Lib/plat-mac/bundlebuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _addMetaFiles(self):
180180
assert len(self.type) == len(self.creator) == 4, \
181181
"type and creator must be 4-byte strings."
182182
pkginfo = pathjoin(contents, "PkgInfo")
183-
f = open(pkginfo, "wb")
183+
f = open(pkginfo, "w")
184184
f.write(self.type + self.creator)
185185
f.close()
186186
#

Lib/plat-mac/macresource.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ def open_pathname(pathname, verbose=0):
7676
AppleSingle file"""
7777
try:
7878
refno = Res.FSpOpenResFile(pathname, 1)
79-
except Res.Error as arg:
80-
if arg[0] in (-37, -39):
79+
except Res.Error as error:
80+
if error.args[0] in (-37, -39):
8181
# No resource fork. We may be on OSX, and this may be either
8282
# a data-fork based resource file or a AppleSingle file
8383
# from the CVS repository.
8484
try:
8585
refno = Res.FSOpenResourceFile(pathname, '', 1)
86-
except Res.Error as arg:
87-
if arg[0] != -199:
86+
except Res.Error as error:
87+
if error.args[0] != -199:
8888
# -199 is "bad resource map"
8989
raise
9090
else:
@@ -103,15 +103,15 @@ def resource_pathname(pathname, verbose=0):
103103
try:
104104
refno = Res.FSpOpenResFile(pathname, 1)
105105
Res.CloseResFile(refno)
106-
except Res.Error as arg:
107-
if arg[0] in (-37, -39):
106+
except Res.Error as error:
107+
if error.args[0] in (-37, -39):
108108
# No resource fork. We may be on OSX, and this may be either
109109
# a data-fork based resource file or a AppleSingle file
110110
# from the CVS repository.
111111
try:
112112
refno = Res.FSOpenResourceFile(pathname, '', 1)
113-
except Res.Error as arg:
114-
if arg[0] != -199:
113+
except Res.Error as error:
114+
if error.args[0] != -199:
115115
# -199 is "bad resource map"
116116
raise
117117
else:

Mac/IDLE/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ IDLE.app: \
5555

5656

5757
Info.plist: $(srcdir)/Info.plist.in
58-
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
58+
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
5959

Mac/PythonLauncher/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ Python\ Launcher: $(OBJECTS)
7878
$(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon
7979

8080
Info.plist: $(srcdir)/Info.plist.in
81-
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
81+
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist

Mac/Tools/fixapplepython23.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ def makescript(filename, compiler):
8080
"""Create a wrapper script for a compiler"""
8181
dirname = os.path.split(filename)[0]
8282
if not os.access(dirname, os.X_OK):
83-
os.mkdir(dirname, 0755)
83+
os.mkdir(dirname, 0o755)
8484
fp = open(filename, 'w')
8585
fp.write(SCRIPT % compiler)
8686
fp.close()
87-
os.chmod(filename, 0755)
87+
os.chmod(filename, 0o755)
8888
print('fixapplepython23: Created', filename)
8989

9090
def main():

Mac/scripts/cachersrc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
class NoArgsError(Exception):
1313
pass
1414

15-
def handler((verbose, force), dirname, fnames):
15+
def handler(arg1, dirname, fnames):
16+
verbose, force = arg1
1617
for fn in fnames:
1718
if fn[-5:] == '.rsrc' and fn[-13:] != '.rsrc.df.rsrc':
1819
if force:

0 commit comments

Comments
 (0)