diff options
Diffstat (limited to 'src/zope/security/tests')
-rw-r--r-- | src/zope/security/tests/test_proxy.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/zope/security/tests/test_proxy.py b/src/zope/security/tests/test_proxy.py index d2e1dbc..fbe4964 100644 --- a/src/zope/security/tests/test_proxy.py +++ b/src/zope/security/tests/test_proxy.py @@ -36,15 +36,6 @@ def _skip_if_Py2(testfunc): return dummy return testfunc -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': - return '0x%08X' % id(obj) - else: - return '0x%0x' % id(obj) - class ProxyTestBase(object): @@ -160,6 +151,7 @@ class ProxyTestBase(object): def test___str___checker_forbids_str(self): from zope.security.interfaces import ForbiddenAttribute from zope.security._compat import _BUILTINS + from zope.security.proxy import _fmt_address target = object() checker = DummyChecker(ForbiddenAttribute) proxy = self._makeOne(target, checker) @@ -177,6 +169,7 @@ class ProxyTestBase(object): def test___repr___checker_forbids_str(self): from zope.security.interfaces import ForbiddenAttribute from zope.security._compat import _BUILTINS + from zope.security.proxy import _fmt_address target = object() checker = DummyChecker(ForbiddenAttribute) proxy = self._makeOne(target, checker) |