[Python-3000-checkins] r57926 - in python/branches/py3k: 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

georg.brandl python-3000-checkins at python.org
Mon Sep 3 09:27:50 CEST 2007


Author: georg.brandl
Date: Mon Sep  3 09:27:49 2007
New Revision: 57926

Modified:
   python/branches/py3k/Lib/plat-mac/Carbon/ControlAccessor.py
   python/branches/py3k/Lib/plat-mac/buildtools.py
   python/branches/py3k/Lib/plat-mac/bundlebuilder.py
   python/branches/py3k/Lib/plat-mac/macresource.py
   python/branches/py3k/Mac/IDLE/Makefile.in
   python/branches/py3k/Mac/PythonLauncher/Makefile.in
   python/branches/py3k/Mac/Tools/fixapplepython23.py
   python/branches/py3k/Mac/scripts/cachersrc.py
Log:
Fix Mac build, patch #1091 by Humberto Diogenes.


Modified: python/branches/py3k/Lib/plat-mac/Carbon/ControlAccessor.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/Carbon/ControlAccessor.py	(original)
+++ python/branches/py3k/Lib/plat-mac/Carbon/ControlAccessor.py	Mon Sep  3 09:27:49 2007
@@ -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

Modified: python/branches/py3k/Lib/plat-mac/buildtools.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/buildtools.py	(original)
+++ python/branches/py3k/Lib/plat-mac/buildtools.py	Mon Sep  3 09:27:49 2007
@@ -17,7 +17,8 @@
 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()

Modified: python/branches/py3k/Lib/plat-mac/bundlebuilder.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/bundlebuilder.py	(original)
+++ python/branches/py3k/Lib/plat-mac/bundlebuilder.py	Mon Sep  3 09:27:49 2007
@@ -180,7 +180,7 @@
         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()
         #

Modified: python/branches/py3k/Lib/plat-mac/macresource.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/macresource.py	(original)
+++ python/branches/py3k/Lib/plat-mac/macresource.py	Mon Sep  3 09:27:49 2007
@@ -76,15 +76,15 @@
     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 @@
     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:

Modified: python/branches/py3k/Mac/IDLE/Makefile.in
==============================================================================
--- python/branches/py3k/Mac/IDLE/Makefile.in	(original)
+++ python/branches/py3k/Mac/IDLE/Makefile.in	Mon Sep  3 09:27:49 2007
@@ -55,5 +55,5 @@
 
 
 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
 

Modified: python/branches/py3k/Mac/PythonLauncher/Makefile.in
==============================================================================
--- python/branches/py3k/Mac/PythonLauncher/Makefile.in	(original)
+++ python/branches/py3k/Mac/PythonLauncher/Makefile.in	Mon Sep  3 09:27:49 2007
@@ -78,4 +78,4 @@
 	$(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

Modified: python/branches/py3k/Mac/Tools/fixapplepython23.py
==============================================================================
--- python/branches/py3k/Mac/Tools/fixapplepython23.py	(original)
+++ python/branches/py3k/Mac/Tools/fixapplepython23.py	Mon Sep  3 09:27:49 2007
@@ -80,11 +80,11 @@
     """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():

Modified: python/branches/py3k/Mac/scripts/cachersrc.py
==============================================================================
--- python/branches/py3k/Mac/scripts/cachersrc.py	(original)
+++ python/branches/py3k/Mac/scripts/cachersrc.py	Mon Sep  3 09:27:49 2007
@@ -12,7 +12,8 @@
 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:


More information about the Python-3000-checkins mailing list