Commits

Ronald Oussoren committed 6ecd0ac

More py3k fixes

  • Participants
  • Parent commits 9afd33b

Comments (0)

Files changed (121)

pyobjc-core/Misc/pyobjc_setup.py

         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-core/PyObjCTest/test_number_proxy.py

         self.assertEqual(OC_TestNumber.numberAsInt_(v), -127)
         self.assertEqual(OC_TestNumber.numberAsLong_(v), -127)
         self.assertEqual(OC_TestNumber.numberAsLongLong_(v), -127)
+
         self.assertEqual(OC_TestNumber.numberAsUnsignedChar_(v), 129)
         self.assertEqual(OC_TestNumber.numberAsUnsignedShort_(v), 65409)
         self.assertEqual(OC_TestNumber.numberAsUnsignedInt_(v), 4294967169)

pyobjc-framework-Accounts/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-AddressBook/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-AppleScriptKit/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-AppleScriptObjC/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-Automator/PyObjCTest/test_automatorerrors.py

     def testConstants(self):
         self.assertEqual(AMAutomatorErrorDomain, "com.apple.Automator")
         self.assertEqual(AMActionErrorKey, "AMActionErrorKey")
-        self.assertIsInstance(AMAutomatorErrorDomain, unicode)
-        self.assertIsInstance(AMActionErrorKey, unicode)
+        self.assertIsInstance(AMAutomatorErrorDomain, (str, unicode))
+        self.assertIsInstance(AMActionErrorKey, (str, unicode))
 
         self.assertEqual(AMWorkflowNewerVersionError, -100)
         self.assertEqual(AMWorkflowPropertyListInvalidError, -101)

pyobjc-framework-Automator/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-CFNetwork/PyObjCTest/test_cfnetservices.py

         self.assertIsInstance(CFNetServiceBrowserGetTypeID(), (int, long))
 
         self.assertResultIsCFRetained(CFNetServiceCreate)
-        serv = CFNetServiceCreate(None, "pyobjc.local", "ssh", "pyobjc.test.local", 9999)
+        serv = CFNetServiceCreate(None, b"pyobjc.local".decode('latin1'), b"ssh".decode('latin1'), b"pyobjc.test.local".decode('latin1'), 9999)
         self.assertIsInstance(serv, CFNetServiceRef)
 
         self.assertResultIsCFRetained(CFNetServiceCreateCopy)

pyobjc-framework-CFNetwork/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-CalendarStore/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-Cocoa/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-Collaboration/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-CoreData/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-CoreLocation/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-CoreText/PyObjCTest/test_coretext.py

 
 from CoreText import *
 
+try:
+    long
+except NameError:
+    long = int
+
 class TestCoreText (TestCase):
     def testConstants(self):
         self.assertEqual(kCTVersionNumber10_5, 0x00020000)

pyobjc-framework-CoreText/PyObjCTest/test_ctfont.py

 from CoreText import *
 from Quartz import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTFont (TestCase):
     def testTypes(self):
         self.assertIsInstance(CTFontRef, objc.objc_class)

pyobjc-framework-CoreText/PyObjCTest/test_ctfontcollection.py

 from PyObjCTools.TestSupport import *
 from CoreText import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTFontCollection (TestCase):
     def testTypes(self):
         self.assertIsInstance(CTFontCollectionRef, objc.objc_class)

pyobjc-framework-CoreText/PyObjCTest/test_ctfontdescriptor.py

 from PyObjCTools.TestSupport import *
 from CoreText import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTFontDescriptor (TestCase):
     def testTypes(self):
         self.assertIsInstance(CTFontDescriptorRef, objc.objc_class)

pyobjc-framework-CoreText/PyObjCTest/test_ctfonttraits.py

 from PyObjCTools.TestSupport import *
 from CoreText import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
 class TestCTFontTraits (TestCase):
 
     def testConstants(self):

pyobjc-framework-CoreText/PyObjCTest/test_ctframe.py

 
 import os
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTFrame (TestCase):
 
     def testTypes(self):

pyobjc-framework-CoreText/PyObjCTest/test_ctframesetter.py

     CGSize = None, None
 
 
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTFramesetter (TestCase):
 
     def testTypes(self):

pyobjc-framework-CoreText/PyObjCTest/test_ctglyphinfo.py

 from PyObjCTools.TestSupport import *
 from CoreText import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTGlyphInfo (TestCase):
     def testTypes(self):
         self.assertIsInstance(CTGlyphInfoRef, objc.objc_class)

pyobjc-framework-CoreText/PyObjCTest/test_ctline.py

 
 import os
 
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTLine (TestCase):
     def testTypes(self):
         self.assertIsInstance(CTLineRef, objc.objc_class)

pyobjc-framework-CoreText/PyObjCTest/test_ctparagraphstyle.py

 from Foundation import NSArray
 import struct, sys
 
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTParagraphStyle (TestCase):
     def testTypes(self):
         self.assertIsCFType(CTParagraphStyleRef)

pyobjc-framework-CoreText/PyObjCTest/test_ctrun.py

 from Foundation import NSDictionary
 from Quartz import *
 
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTRun (TestCase):
     def testTypes(self):
         self.assertIsCFType(CTRunRef)

pyobjc-framework-CoreText/PyObjCTest/test_ctstringattributes.py

 from PyObjCTools.TestSupport import *
 from CoreText import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
 class TestCTStringAttributes (TestCase):
     def testConstants(self):
         self.assertIsInstance(kCTFontAttributeName, unicode)

pyobjc-framework-CoreText/PyObjCTest/test_cttexttab.py

 from PyObjCTools.TestSupport import *
 from CoreText import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTTextTab (TestCase):
     def testTypes(self):
         self.assertIsCFType(CTTextTabRef)

pyobjc-framework-CoreText/PyObjCTest/test_cttypesetter.py

 from PyObjCTools.TestSupport import *
 from CoreText import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestCTTypesetter (TestCase):
     def testTypes(self):
         self.assertIsCFType(CTTypesetterRef)

pyobjc-framework-CoreText/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-DictionaryServices/PyObjCTest/test_dictionaryservices.py

 from PyObjCTools.TestSupport import *
 from DictionaryServices import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestDictionaryServices (TestCase):
     def testClasses(self):
         self.assertIsCFType(DCSDictionaryRef)
 
     
     def testFunctions(self):
-        r = DCSGetTermRangeInString(None, u"the hello world program", 5)
+        r = DCSGetTermRangeInString(None, b"the hello world program".decode('latin1'), 5)
         self.assertIsInstance(r, CFRange)
         self.assertEqual(r, (4, 5))
 
-        r = DCSCopyTextDefinition(None, u"the hello world program", r)
+        r = DCSCopyTextDefinition(None, b"the hello world program".decode('latin1'), r)
         self.assertIsInstance(r, unicode)
 
         v = DCSDictionaryGetTypeID()

pyobjc-framework-DictionaryServices/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-ExceptionHandling/Lib/ExceptionHandling/_metadata.py

 # This file is generated by objective.metadata
 #
-# Last update: Fri May 25 17:49:12 2012
+# Last update: Tue May 29 07:40:07 2012
 
 import objc, sys
 
     r(b'NSObject', b'exceptionHandler:shouldLogException:mask:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': sel32or64(b'I', b'L')}}})
 finally:
     objc._updatingMetadata(False)
-protocols={'NSExceptionHandlerDelegate': objc.informal_protocol('NSExceptionHandlerDelegate', [objc.selector(None, b'exceptionHandler:shouldLogException:mask:', b"sel32or64(b'Z@:@@I', b'Z@:@@L')", isRequired=False), objc.selector(None, b'exceptionHandler:shouldHandleException:mask:', b"sel32or64(b'Z@:@@I', b'Z@:@@L')", isRequired=False)])}
+protocols={'NSExceptionHandlerDelegate': objc.informal_protocol('NSExceptionHandlerDelegate', [objc.selector(None, b'exceptionHandler:shouldLogException:mask:', sel32or64(b'Z@:@@I', b'Z@:@@L'), isRequired=False), objc.selector(None, b'exceptionHandler:shouldHandleException:mask:', sel32or64(b'Z@:@@I', b'Z@:@@L'), isRequired=False)])}
 expressions = {'NSHangOnEveryExceptionMask': '(NSHangOnUncaughtExceptionMask|NSHangOnUncaughtSystemExceptionMask|NSHangOnUncaughtRuntimeErrorMask|NSHangOnTopLevelExceptionMask|NSHangOnOtherExceptionMask)', 'NSLogAndHandleEveryExceptionMask': '(NSLogUncaughtExceptionMask|NSLogUncaughtSystemExceptionMask|NSLogUncaughtRuntimeErrorMask|NSHandleUncaughtExceptionMask|NSHandleUncaughtSystemExceptionMask|NSHandleUncaughtRuntimeErrorMask|NSLogTopLevelExceptionMask|NSHandleTopLevelExceptionMask|NSLogOtherExceptionMask|NSHandleOtherExceptionMask)'}
 
 # END OF FILE

pyobjc-framework-ExceptionHandling/PyObjCTest/test_nsexceptionhandler.py

 from PyObjCTools.TestSupport import *
 from ExceptionHandling import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
 class TestNSExceptionHandlerHelper (NSObject):
     def exceptionHandler_shouldLogException_mask_(self, h, e, m):
         return False

pyobjc-framework-ExceptionHandling/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-FSEvents/Lib/FSEvents/_metadata.py

 # This file is generated by objective.metadata
 #
-# Last update: Fri May 25 17:49:05 2012
+# Last update: Tue May 29 07:57:40 2012
 
 import objc, sys
 

pyobjc-framework-FSEvents/PyObjCTest/test_fsevents.py

 from PyObjCTools.TestSupport import *
 import os, time
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
+try:
+    long
+except NameError:
+    long = int
+
 class TestFSEvents (TestCase):
 
     def testValues(self):

pyobjc-framework-FSEvents/metadata/CoreServices.fwinfo

 	"ignore": true
     },
     "FSEventStreamRef": {
-    	"opaque": true
+    	"opaque": true,
+	"typestr": "^{__FSEventStream=}"
     }
   },
   "formal_protocols": {}, 

pyobjc-framework-FSEvents/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-InputMethodKit/Lib/InputMethodKit/_metadata.py

 # This file is generated by objective.metadata
 #
-# Last update: Fri May 25 17:48:59 2012
+# Last update: Tue May 29 07:42:31 2012
 
 import objc, sys
 
     r(b'NSObject', b'originalString:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}})
 finally:
     objc._updatingMetadata(False)
-protocols={'IMKServerInput': objc.informal_protocol('IMKServerInput', [objc.selector(None, b'inputText:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'candidates:', b'@@:@', isRequired=False), objc.selector(None, b'didCommandBySelector:client:', b'Z@::@', isRequired=False), objc.selector(None, b'handleEvent:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'composedString:', b'@@:@', isRequired=False), objc.selector(None, b'inputText:key:modifiers:client:', b"sel32or64(b'Z@:@iI@', b'Z@:@lL@')", isRequired=False), objc.selector(None, b'commitComposition:', b'v@:@', isRequired=False), objc.selector(None, b'originalString:', b'@@:@', isRequired=False)])}
+protocols={'IMKServerInput': objc.informal_protocol('IMKServerInput', [objc.selector(None, b'inputText:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'candidates:', b'@@:@', isRequired=False), objc.selector(None, b'didCommandBySelector:client:', b'Z@::@', isRequired=False), objc.selector(None, b'handleEvent:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'composedString:', b'@@:@', isRequired=False), objc.selector(None, b'inputText:key:modifiers:client:', sel32or64(b'Z@:@iI@', b'Z@:@lL@'), isRequired=False), objc.selector(None, b'commitComposition:', b'v@:@', isRequired=False), objc.selector(None, b'originalString:', b'@@:@', isRequired=False)])}
 expressions = {}
 
 # END OF FILE

pyobjc-framework-InputMethodKit/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-InstallerPlugins/PyObjCTest/test_installerstate.py

 from PyObjCTools.TestSupport import *
 from InstallerPlugins import *
 
+try:
+    unicode
+except NameError:
+    unicode = str
+
 class TestInstallerState (TestCase):
     def testConstants(self):
         self.assertIsInstance(InstallerState_Choice_Identifier, unicode)

pyobjc-framework-InstallerPlugins/pyobjc_setup.py

         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
         class no_test (oc_test):
             def run(self):
-                print("WARNING: %s"%(msg,))
-                print()
+                print("WARNING: %s\n"%(msg,))
                 print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = oc_test
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else: