summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2016-06-06 12:47:22 +0300
committerMarius Gedminas <marius@gedmin.as>2016-06-06 12:47:22 +0300
commit6292afe78a5eee46405d982405fcc63603478504 (patch)
treef98c235c1f6fcf844e5cd1aed6493425f38dff61
parente947f88e772f02c0214a807cb5187a7fa3c1e488 (diff)
parent066dd259af0289efd7551a33ea5cf2d5fb1dc476 (diff)
downloadzope-security-6292afe78a5eee46405d982405fcc63603478504.tar.gz
Merge pull request #18 from zopefoundation/fix-win64-maybe
Fix tests on 64-bit Windows
-rw-r--r--appveyor.yml26
-rw-r--r--src/zope/security/proxy.py6
2 files changed, 30 insertions, 2 deletions
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..7bcc4c5
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,26 @@
+environment:
+
+ matrix:
+ - python : 27
+ - python : 27-x64
+ - python : 33
+ - python : 33-x64
+ - python : 34
+ - python : 34-x64
+ - python : 35
+ - python : 35-x64
+ - { python: 27, PURE_PYTHON: 1 }
+ - { python: 35, PURE_PYTHON: 1 }
+
+install:
+ - "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%"
+ - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
+ - pip install -e .
+
+build: false
+
+test_script:
+ - python setup.py -q test -q
+
+on_success:
+ - echo Build succesful!
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):