summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-03 07:27:49 (GMT)
committerGeorg Brandl <georg@python.org>2007-09-03 07:27:49 (GMT)
commitc76473d887c446dd9693f6549a59bff53b4d5ef6 (patch)
tree023b4d4cf56a080655082277f606efacaa0bcf99 /Lib
parente4ac7504c9fb005d81c710bff40777dc170694a8 (diff)
downloadcpython-c76473d887c446dd9693f6549a59bff53b4d5ef6.zip
cpython-c76473d887c446dd9693f6549a59bff53b4d5ef6.tar.gz
cpython-c76473d887c446dd9693f6549a59bff53b4d5ef6.tar.bz2
Fix Mac build, patch #1091 by Humberto Diogenes.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/plat-mac/Carbon/ControlAccessor.py2
-rw-r--r--Lib/plat-mac/buildtools.py3
-rwxr-xr-xLib/plat-mac/bundlebuilder.py2
-rw-r--r--Lib/plat-mac/macresource.py16
4 files changed, 12 insertions, 11 deletions
diff --git a/Lib/plat-mac/Carbon/ControlAccessor.py b/Lib/plat-mac/Carbon/ControlAccessor.py
index 7833b16..fcf44af 100644
--- a/Lib/plat-mac/Carbon/ControlAccessor.py
+++ b/Lib/plat-mac/Carbon/ControlAccessor.py
@@ -1,6 +1,6 @@
# Accessor functions for control properties
-from Controls import *
+from Carbon.Controls import *
import struct
# These needn't go through this module, but are here for completeness
diff --git a/Lib/plat-mac/buildtools.py b/Lib/plat-mac/buildtools.py
index 2422612..1545014 100644
--- a/Lib/plat-mac/buildtools.py
+++ b/Lib/plat-mac/buildtools.py
@@ -17,7 +17,8 @@ import warnings
warnings.warn("the buildtools module is deprecated", DeprecationWarning, 2)
-BuildError = "BuildError"
+class BuildError(Exception):
+ pass
# .pyc file (and 'PYC ' resource magic number)
MAGIC = imp.get_magic()
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py
index 4fee311..bb40653 100755
--- a/Lib/plat-mac/bundlebuilder.py
+++ b/Lib/plat-mac/bundlebuilder.py
@@ -180,7 +180,7 @@ class BundleBuilder(Defaults):
assert len(self.type) == len(self.creator) == 4, \
"type and creator must be 4-byte strings."
pkginfo = pathjoin(contents, "PkgInfo")
- f = open(pkginfo, "wb")
+ f = open(pkginfo, "w")
f.write(self.type + self.creator)
f.close()
#
diff --git a/Lib/plat-mac/macresource.py b/Lib/plat-mac/macresource.py
index 14581a3..4592ff5 100644
--- a/Lib/plat-mac/macresource.py
+++ b/Lib/plat-mac/macresource.py
@@ -76,15 +76,15 @@ def open_pathname(pathname, verbose=0):
AppleSingle file"""
try:
refno = Res.FSpOpenResFile(pathname, 1)
- except Res.Error as arg:
- if arg[0] in (-37, -39):
+ except Res.Error as error:
+ if error.args[0] in (-37, -39):
# No resource fork. We may be on OSX, and this may be either
# a data-fork based resource file or a AppleSingle file
# from the CVS repository.
try:
refno = Res.FSOpenResourceFile(pathname, '', 1)
- except Res.Error as arg:
- if arg[0] != -199:
+ except Res.Error as error:
+ if error.args[0] != -199:
# -199 is "bad resource map"
raise
else:
@@ -103,15 +103,15 @@ def resource_pathname(pathname, verbose=0):
try:
refno = Res.FSpOpenResFile(pathname, 1)
Res.CloseResFile(refno)
- except Res.Error as arg:
- if arg[0] in (-37, -39):
+ except Res.Error as error:
+ if error.args[0] in (-37, -39):
# No resource fork. We may be on OSX, and this may be either
# a data-fork based resource file or a AppleSingle file
# from the CVS repository.
try:
refno = Res.FSOpenResourceFile(pathname, '', 1)
- except Res.Error as arg:
- if arg[0] != -199:
+ except Res.Error as error:
+ if error.args[0] != -199:
# -199 is "bad resource map"
raise
else: