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:29 -0400 |
| commit | 4580f942fb851963ce09a05a0c3e6ad6b861ed7d (patch) | |
| tree | 52b46e9baf6743377030312ff4edde99c63931ea /lib/sqlalchemy/util/__init__.py | |
| parent | 5cad77a87bbfc98999454ab5314a47895d5beded (diff) | |
| download | sqlalchemy-4580f942fb851963ce09a05a0c3e6ad6b861ed7d.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
(cherry picked from commit a59c3b8f302a34ab037ec445b7452b1f353b91af)
Diffstat (limited to 'lib/sqlalchemy/util/__init__.py')
| -rw-r--r-- | lib/sqlalchemy/util/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/util/__init__.py b/lib/sqlalchemy/util/__init__.py index 2a2d5cfc6..031376d78 100644 --- a/lib/sqlalchemy/util/__init__.py +++ b/lib/sqlalchemy/util/__init__.py @@ -21,7 +21,7 @@ from ._collections import KeyedTuple, ImmutableContainer, immutabledict, \ UniqueAppender, PopulateDict, EMPTY_SET, to_list, to_set, \ to_column_set, update_copy, flatten_iterator, has_intersection, \ LRUCache, ScopedRegistry, ThreadLocalRegistry, WeakSequence, \ - coerce_generator_arg, lightweight_named_tuple + coerce_generator_arg, lightweight_named_tuple, collections_abc from .langhelpers import iterate_attributes, class_hierarchy, \ portable_instancemethod, unbound_method_to_callable, \ |
