Skip to content

Commit

Permalink
Add support for Python 3.10 + increase coverage for Python >= 3.7.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Feb 17, 2022
1 parent 91fd300 commit 4aff22b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -7,6 +7,7 @@

- Switch package to src-layout, this is a packaging only change.
(`#168 <https://github.com/zopefoundation/persistent/pull/168>`_)
- Add support for Python 3.10.


4.7.0 (2021-04-13)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -101,6 +101,7 @@ def _read_file(filename):
"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",
"Framework :: ZODB",
Expand Down
4 changes: 2 additions & 2 deletions src/persistent/list.py
Expand Up @@ -55,7 +55,7 @@ class PersistentList(UserList, persistent.Persistent):
else lambda inst: inst.__delitem__(_SLICE_ALL)
)

if not PYTHON2 and sys.version_info[:3] < (3, 7, 4):
if not PYTHON2 and sys.version_info[:3] < (3, 7, 4): # pragma: no cover
# Prior to 3.7.4, Python 3 (but not Python 2) failed to properly
# return an instance of the same class.
# See https://bugs.python.org/issue27639
Expand All @@ -68,7 +68,7 @@ def __getitem__(self, item):
result = self.__class__(result)
return result

if sys.version_info[:3] < (3, 7, 4):
if sys.version_info[:3] < (3, 7, 4): # pragma: no cover
# Likewise for __copy__, except even Python 2 needs it.
# See https://github.com/python/cpython/commit/3645d29a1dc2102fdb0f5f0c0129ff2295bcd768
def __copy__(self):
Expand Down
5 changes: 2 additions & 3 deletions src/persistent/tests/test_ring.py
Expand Up @@ -27,9 +27,8 @@ def _next_oid(cls):
cls.__next_oid += 1
return cls.__next_oid

def __init__(self, oid=None):
if oid is None:
self._p_oid = self._next_oid()
def __init__(self):
self._p_oid = self._next_oid()

def __repr__(self): # pragma: no cover
return "<Dummy %r at 0x%x>" % (self._p_oid, id(self))
Expand Down

0 comments on commit 4aff22b

Please sign in to comment.