From fe91e3f52816f0d69b292e2cbbaeeed21777e7d3 Mon Sep 17 00:00:00 2001 From: Shenghao Yang Date: Fri, 1 Apr 2022 18:16:26 +0800 Subject: [PATCH 1/2] node: fix deprecated Iterable import in py3.10 Import from collections.abc instead if import from collections fails. --- testgres/node.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testgres/node.py b/testgres/node.py index 8e64da01..d1bb1d97 100644 --- a/testgres/node.py +++ b/testgres/node.py @@ -6,7 +6,11 @@ import subprocess import time -from collections import Iterable +try: + from collections import Iterable +except ImportError: + from collections.abc import Iterable + from shutil import rmtree from six import raise_from, iteritems, text_type from tempfile import mkstemp, mkdtemp From 73135272fd84108e9403eb9dada9ae2024efb773 Mon Sep 17 00:00:00 2001 From: "Mikhail A. Kulagin" Date: Mon, 11 Apr 2022 19:52:09 +0300 Subject: [PATCH 2/2] python-3.10: moved more generic imports up --- testgres/node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testgres/node.py b/testgres/node.py index ae41fe1f..cabbbd1a 100644 --- a/testgres/node.py +++ b/testgres/node.py @@ -7,9 +7,9 @@ import time try: - from collections import Iterable -except ImportError: from collections.abc import Iterable +except ImportError: + from collections import Iterable from shutil import rmtree from six import raise_from, iteritems, text_type