diff options
author | Marius Gedminas <marius@gedmin.as> | 2016-06-06 10:47:36 +0300 |
---|---|---|
committer | Marius Gedminas <marius@gedmin.as> | 2016-06-06 10:47:36 +0300 |
commit | 7a677d8e92774290c6ce4e92b5ebac8b25209277 (patch) | |
tree | 6832aad5aa639c7c854e081169d76a3a302b4b78 | |
parent | 82d9e1ecd989a10b6bbf21774bb067ae4e32402d (diff) | |
download | zope-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.py | 6 |
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): |