Skip to content

Commit

Permalink
Fix test failures on 64-bit Windows
Browse files Browse the repository at this point in the history
Hopefully.  Appveyor should tell me if I've succeeded.

Fixes #17.
  • Loading branch information
mgedmin committed Jun 6, 2016
1 parent 82d9e1e commit 7a677d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/zope/security/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ def _fmt_address(obj):
# Try to replicate PyString_FromString("%p", obj), which actually uses
# the platform sprintf(buf, "%p", obj), which we cannot access from Python
# directly (and ctypes seems like overkill).
if sys.platform == 'win32':
if sys.platform != 'win32':
return '0x%0x' % id(obj)
elif sys.maxsize < 2**32:
return '0x%08X' % id(obj)
else:
return '0x%0x' % id(obj)
return '0x%016X' % id(obj)


class ProxyPy(PyProxyBase):
Expand Down

0 comments on commit 7a677d8

Please sign in to comment.