summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Howitz <mh@gocept.com>2021-11-23 08:24:30 +0100
committerMichael Howitz <mh@gocept.com>2021-11-23 08:24:30 +0100
commit24075deef5fa998ced091b05b54699f10a3776b5 (patch)
treeb74c65ee2fcc653524337fa78a2d622b6051afdb
parentc604df3bf2a44538a006bbf6414121a6aa0abbb9 (diff)
downloadzope-security-config-with-c-code.tar.gz
Fix tests on Python 3.10 + lint.config-with-c-code
-rw-r--r--CHANGES.rst2
-rw-r--r--docs/proxy.rst5
-rw-r--r--setup.py1
-rw-r--r--src/zope/security/checker.py2
-rw-r--r--src/zope/security/decorator.py2
5 files changed, 8 insertions, 4 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 35f7f4d..1be5aa6 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -5,7 +5,7 @@
5.2 (unreleased)
================
-- Add support for Python 3.9.
+- Add support for Python 3.9 and 3.10.
5.1.1 (2020-03-23)
diff --git a/docs/proxy.rst b/docs/proxy.rst
index 5262e7a..971975e 100644
--- a/docs/proxy.rst
+++ b/docs/proxy.rst
@@ -320,7 +320,10 @@ unexpectedly:
.. doctest::
- >>> from collections import Mapping
+ >>> try:
+ ... from collections.abc import Mapping
+ ... except ImportError: # PY2
+ ... from collections import Mapping
>>> from abc import ABCMeta
>>> isinstance(Mapping, ABCMeta)
True
diff --git a/setup.py b/setup.py
index c82a049..470416a 100644
--- a/setup.py
+++ b/setup.py
@@ -157,6 +157,7 @@ setup(name='zope.security',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
diff --git a/src/zope/security/checker.py b/src/zope/security/checker.py
index 67723e8..fe570d1 100644
--- a/src/zope/security/checker.py
+++ b/src/zope/security/checker.py
@@ -135,7 +135,7 @@ def ProxyFactory(object, checker=None):
directlyProvides(ProxyFactory, ISecurityProxyFactory)
# This import represents part of the API for the proxy module
-from . import proxy
+from . import proxy # noqa: E402 module level import not at top
proxy.ProxyFactory = ProxyFactory
diff --git a/src/zope/security/decorator.py b/src/zope/security/decorator.py
index dfd6fc7..0f9f2f4 100644
--- a/src/zope/security/decorator.py
+++ b/src/zope/security/decorator.py
@@ -74,6 +74,6 @@ class DecoratorBase(SpecificationDecoratorBase, SecurityCheckerDecoratorBase):
# location proxy from here.
# This is the only sane place we found for doing it: it kicks in as soon
# as someone starts using security proxies.
-import zope.location.location
+import zope.location.location # noqa: E402 module level import not at top
zope.location.location.LocationProxy.__Security_checker__ = (
DecoratedSecurityCheckerDescriptor())