Anonymous avatar Anonymous committed 078133f

replace unportable (across Python implementations) test with more explicit one; thanks anatoly

Comments (0)

Files changed (1)

pyglet/libs/win32/__init__.py

 #!/usr/bin/python
 # $Id: $
 
+import struct
 from ctypes import *
 
 import pyglet
 import constants
 from types import *
 
+IS64 = struct.calcsize("P") == 8
+
 _debug_win32 = pyglet.options['debug_win32']
 
 if _debug_win32:
 _user32.SetCapture.argtypes = [HWND]
 _user32.SetClassLongW.restype = DWORD
 _user32.SetClassLongW.argtypes = [HWND, c_int, LONG]
-if tuple.__itemsize__ == 8:
+if IS64:
     _user32.SetClassLongPtrW.restype = ULONG
     _user32.SetClassLongPtrW.argtypes = [HWND, c_int, LONG_PTR]
 else:
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.