Commits

Lenard Lindstrom  committed ae2160c

Patch Python 3.3 pygame.pkgdata bug for issue #146

The ftfont_test.py unit tests now pass for Python 3.3. The may not be a final
solution for pkgdata. But then, Python 3.3 truly breaks pkgdata.

  • Participants
  • Parent commits 6eb7090

Comments (0)

Files changed (1)

File lib/pkgdata.py

     if fn is None:
         raise IOError("%s has no __file__!" % repr(mod))
     path = os.path.join(os.path.dirname(fn), identifier)
-    loader = getattr(mod, '__loader__', None)
-    if loader is not None:
-        try:
-            data = loader.get_data(path)
-        except IOError:
-            pass
-        else:
-            return BytesIO(data)
+    if sys.version_info < (3, 3):
+        loader = getattr(mod, '__loader__', None)
+        if loader is not None:
+            try:
+                data = loader.get_data(path)
+            except IOError:
+                pass
+            else:
+                return BytesIO(data)
     return open(os.path.normpath(path), 'rb')