diff options
author | Nathaniel Knight <nknight@cfenet.ubc.ca> | 2018-07-31 21:59:47 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-08-01 12:30:09 -0400 |
commit | a51b0528d3dca59e655e4d19b50bb271015f8196 (patch) | |
tree | 5a50c4981c5dbd71e4a0a4cbde252b8571d4f180 /test/sql/test_operators.py | |
parent | 1c32206120b1a6555f8bb7a20a0c4c53ea2f52a8 (diff) | |
download | sqlalchemy-a51b0528d3dca59e655e4d19b50bb271015f8196.tar.gz |
Fix collections ABC access before Python 3.8
Started importing "collections" from "collections.abc" under Python 3.3 and
greater for Python 3.8 compatibility. Pull request courtesy Nathaniel
Knight.
In Python 3.3, the abstract base classes (Iterable, Mapping, etc.)
were moved from the `collections` module and put in the
`collections.abc` module. They remain in the `collections` module for
backwards compatibility, and will until Python 3.8.
This commit adds a variable (`collections_abc`) to the `util/compat`
module, which will be the `collections` module for Python < 3.3 and
before, or the `collections.abc` module for Python >= 3.3. It also
uses the new variable, getting rid of some deprecation warnings that
were seen when running under Python 3.7.
Change-Id: I2d1c0ef97c8ecac7af152cc56263422a40faa6bb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/464
Diffstat (limited to 'test/sql/test_operators.py')
-rw-r--r-- | test/sql/test_operators.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index f5446a856..f4b3cf584 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -636,7 +636,7 @@ class ExtensionOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL): return self.op("->")(index) col = Column('x', MyType()) - assert not isinstance(col, collections.Iterable) + assert not isinstance(col, util.collections_abc.Iterable) def test_lshift(self): class MyType(UserDefinedType): |