Control: tags 997361 + patch

Dear maintainer,

I've prepared an NMU for testresources (versioned as 2.0.1-2.1). The diff
is attached to this message.

Regards.

SR
diff -Nru testresources-2.0.1/debian/changelog testresources-2.0.1/debian/changelog
--- testresources-2.0.1/debian/changelog	2020-05-08 06:08:01.000000000 -0400
+++ testresources-2.0.1/debian/changelog	2021-12-09 17:52:35.000000000 -0400
@@ -1,3 +1,10 @@
+testresources (2.0.1-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Patch: Python 3.10 support.  Closes: #997361
+
+ -- Stefano Rivera <stefa...@debian.org>  Thu, 09 Dec 2021 17:52:35 -0400
+
 testresources (2.0.1-2) unstable; urgency=medium
 
   * Uploading to unstable.
diff -Nru testresources-2.0.1/debian/patches/python3.10.patch testresources-2.0.1/debian/patches/python3.10.patch
--- testresources-2.0.1/debian/patches/python3.10.patch	1969-12-31 20:00:00.000000000 -0400
+++ testresources-2.0.1/debian/patches/python3.10.patch	2021-12-09 17:52:35.000000000 -0400
@@ -0,0 +1,39 @@
+From: Athos Ribeiro <athos.ribe...@canonical.com>
+Date: Thu, 9 Dec 2021 17:45:47 -0400
+Subject: Use MutableSet collections.abc if available
+
+Python 3.10 removed the aliases to collections.abc from the collections
+module. See [1] for reference.
+
+[1] https://docs.python.org/3/whatsnew/3.10.html#removed
+
+Signed-off-by: Athos Ribeiro <athos.ribe...@canonical.com>
+---
+ testresources/__init__.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/testresources/__init__.py b/testresources/__init__.py
+index 26363dd..c1a2ad0 100644
+--- a/testresources/__init__.py
++++ b/testresources/__init__.py
+@@ -20,7 +20,10 @@
+ import heapq
+ import inspect
+ import unittest
+-import collections
++try:
++    from collections.abc import MutableSet
++except ImportError:
++    from collections import MutableSet
+ try:
+     import unittest2
+ except ImportError:
+@@ -192,7 +195,7 @@ def _strongly_connected_components(graph, no_resources):
+     return partitions
+ 
+ 
+-class _OrderedSet(collections.MutableSet):
++class _OrderedSet(MutableSet):
+     """This is taken from the OrderedSet recipe link in the Python 2 docs.
+ 
+     See:
diff -Nru testresources-2.0.1/debian/patches/series testresources-2.0.1/debian/patches/series
--- testresources-2.0.1/debian/patches/series	2020-05-08 06:08:01.000000000 -0400
+++ testresources-2.0.1/debian/patches/series	2021-12-09 17:52:35.000000000 -0400
@@ -1 +1,2 @@
 remove-non-deterministic-ftbfs-testBasicSortTests.patch
+python3.10.patch

Reply via email to