Commits

Virgil Dupras committed f3a8e44

Improved the BSCompiler to generate proper metadata under py3k.

Comments (0)

Files changed (1)

pyobjc-core/Lib/PyObjCTools/_BSCompiler.py

     print >>fp, ""
     print >>fp, "import objc, sys"
     print >>fp, ""
-    print >>fp, "if sys.maxint > 2 ** 32:"
+    print >>fp, "try:"
+    print >>fp, "    maxsize = sys.maxsize"
+    print >>fp, "except AttributeError:"
+    print >>fp, "    maxsize = sys.maxint"
+    print >>fp, "if maxsize > 2 ** 32:"
     print >>fp, "    def sel32or64(a, b): return b"
     print >>fp, "else:"
     print >>fp, "    def sel32or64(a, b): return a"
             continue
 
         name = node.get('name')
-        types = [b'v']
-        types64 = [b'v']
+        types = ['v']
+        types64 = ['v']
         retval = None
         arguments = []
         meta = {}
             types64[0] = 'v'
 
 
-        types = ''.join(types)
-        types64 = ''.join(types64)
+        types = bstr(''.join(types))
+        types64 = bstr(''.join(types64))
 
         if types != types64:
             if meta is None:
     print >>fp, "cftypes = []"
     for node in tree.findall('.//cftype'):
         name = node.get('name')
-        type = node.get('type')
-        type64= node.get('type64')
+        type = bstr(node.get('type'))
+        type64= bstr(node.get('type64'))
         if type64 is not None and type64 != type:
             type = sel32or64(type, type64)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.