]> granicus.if.org Git - python/commitdiff
Fix Mac build, patch #1091 by Humberto Diogenes.
authorGeorg Brandl <georg@python.org>
Mon, 3 Sep 2007 07:27:49 +0000 (07:27 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 3 Sep 2007 07:27:49 +0000 (07:27 +0000)
Lib/plat-mac/Carbon/ControlAccessor.py
Lib/plat-mac/buildtools.py
Lib/plat-mac/bundlebuilder.py
Lib/plat-mac/macresource.py
Mac/IDLE/Makefile.in
Mac/PythonLauncher/Makefile.in
Mac/Tools/fixapplepython23.py
Mac/scripts/cachersrc.py

index 7833b169598c9adfaedcc0fa103424b69bd77471..fcf44afe9f3e77a1752b24cd1dd2dae6fe8ea5d1 100644 (file)
@@ -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
index 24226126fcdfe2f4591f5a844580b3c7f122dff0..15450142233329c69c775f28a452e0391b80ed7c 100644 (file)
@@ -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()
index 4fee3113056f2f51c3da038a5f330dd0f415c208..bb40653745a25ea201fcfa3fe7ec41417e7c8f4c 100755 (executable)
@@ -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()
         #
index 14581a3eb0e181ca2afb78489e8463d3c36ea374..4592ff57d016dc37daeb95b85102399f6d44aa0c 100644 (file)
@@ -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:
index 2f63892a07189683751d4602aa36538e9a8cf035..da6922e023722f3e49ee8ef77c06587282026c2c 100644 (file)
@@ -55,5 +55,5 @@ IDLE.app:  \
 
 
 Info.plist: $(srcdir)/Info.plist.in
-       sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
+       sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
 
index b4b126c908d9d036eff87b58fde57c05ca46c950..f27e21e5e1ecaed1373f4b4844d97ac395056231 100644 (file)
@@ -78,4 +78,4 @@ Python\ Launcher: $(OBJECTS)
        $(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon
 
 Info.plist: $(srcdir)/Info.plist.in
-       sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
+       sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
index 01a09b5896f03f73c32970b7ba202fb5113a17f0..b0916e81cb091ccf2950046e06c267253ba6dbe7 100644 (file)
@@ -80,11 +80,11 @@ def makescript(filename, compiler):
     """Create a wrapper script for a compiler"""
     dirname = os.path.split(filename)[0]
     if not os.access(dirname, os.X_OK):
-        os.mkdir(dirname, 0755)
+        os.mkdir(dirname, 0o755)
     fp = open(filename, 'w')
     fp.write(SCRIPT % compiler)
     fp.close()
-    os.chmod(filename, 0755)
+    os.chmod(filename, 0o755)
     print('fixapplepython23: Created', filename)
 
 def main():
index e2eed8b270546987cdde5fd3b0f55549359ec855..e0e84158c67a0f13d4a9fc8f6f5aaaf03ea58565 100644 (file)
@@ -12,7 +12,8 @@ import getopt
 class NoArgsError(Exception):
     pass
 
-def handler((verbose, force), dirname, fnames):
+def handler(arg1, dirname, fnames):
+    verbose, force = arg1
     for fn in fnames:
         if fn[-5:] == '.rsrc' and fn[-13:] != '.rsrc.df.rsrc':
             if force: