summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2016-06-06 10:47:36 +0300
committerMarius Gedminas <marius@gedmin.as>2016-06-06 10:47:36 +0300
commit7a677d8e92774290c6ce4e92b5ebac8b25209277 (patch)
tree6832aad5aa639c7c854e081169d76a3a302b4b78
parent82d9e1ecd989a10b6bbf21774bb067ae4e32402d (diff)
downloadzope-security-7a677d8e92774290c6ce4e92b5ebac8b25209277.tar.gz
Fix test failures on 64-bit Windows
Hopefully. Appveyor should tell me if I've succeeded. Fixes #17.
-rw-r--r--src/zope/security/proxy.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zope/security/proxy.py b/src/zope/security/proxy.py
index ccfd111..d7f12e2 100644
--- a/src/zope/security/proxy.py
+++ b/src/zope/security/proxy.py
@@ -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):