Title: [965] trunk/tests/test_dbapi20_copy.py: Avoid warning in Python 3.7 (and error later in 3.8)
Revision
965
Author
cito
Date
2019-01-05 10:42:17 -0500 (Sat, 05 Jan 2019)

Log Message

Avoid warning in Python 3.7 (and error later in 3.8)

Modified Paths


Diff

Modified: branches/5.0.x/pgdb.py (964 => 965)


--- branches/5.0.x/pgdb.py	2019-01-05 13:51:23 UTC (rev 964)
+++ branches/5.0.x/pgdb.py	2019-01-05 15:42:17 UTC (rev 965)
@@ -74,7 +74,11 @@
 from decimal import Decimal
 from uuid import UUID as Uuid
 from math import isnan, isinf
-from collections import namedtuple, Iterable
+try:
+    from collections.abc import Iterable
+except ImportError:  # Python < 3.3
+    from collections import Iterable
+from collections import namedtuple
 from keyword import iskeyword
 from functools import partial
 from re import compile as regex

Modified: branches/5.0.x/tests/test_dbapi20_copy.py (964 => 965)


--- branches/5.0.x/tests/test_dbapi20_copy.py	2019-01-05 13:51:23 UTC (rev 964)
+++ branches/5.0.x/tests/test_dbapi20_copy.py	2019-01-05 15:42:17 UTC (rev 965)
@@ -15,7 +15,10 @@
 except ImportError:
     import unittest
 
-from collections import Iterable
+try:
+    from collections.abc import Iterable
+except ImportError:  # Python < 3.3
+    from collections import Iterable
 
 import pgdb  # the module under test
 

Modified: trunk/pgdb.py (964 => 965)


--- trunk/pgdb.py	2019-01-05 13:51:23 UTC (rev 964)
+++ trunk/pgdb.py	2019-01-05 15:42:17 UTC (rev 965)
@@ -74,7 +74,11 @@
 from decimal import Decimal
 from uuid import UUID as Uuid
 from math import isnan, isinf
-from collections import namedtuple, Iterable
+try:
+    from collections.abc import Iterable
+except ImportError:  # Python < 3.3
+    from collections import Iterable
+from collections import namedtuple
 from keyword import iskeyword
 from functools import partial
 from re import compile as regex

Modified: trunk/tests/test_dbapi20_copy.py (964 => 965)


--- trunk/tests/test_dbapi20_copy.py	2019-01-05 13:51:23 UTC (rev 964)
+++ trunk/tests/test_dbapi20_copy.py	2019-01-05 15:42:17 UTC (rev 965)
@@ -15,7 +15,10 @@
 except ImportError:
     import unittest
 
-from collections import Iterable
+try:
+    from collections.abc import Iterable
+except ImportError:  # Python < 3.3
+    from collections import Iterable
 
 import pgdb  # the module under test
 
_______________________________________________
PyGreSQL mailing list
PyGreSQL@Vex.Net
https://mail.vex.net/mailman/listinfo/pygresql

Reply via email to