summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/json.py5
-rw-r--r--lib/sqlalchemy/engine/result.py3
-rw-r--r--lib/sqlalchemy/sql/base.py5
-rw-r--r--lib/sqlalchemy/sql/sqltypes.py2
4 files changed, 6 insertions, 9 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/json.py b/lib/sqlalchemy/dialects/postgresql/json.py
index 740118030..1a1367f1b 100644
--- a/lib/sqlalchemy/dialects/postgresql/json.py
+++ b/lib/sqlalchemy/dialects/postgresql/json.py
@@ -7,7 +7,6 @@
from __future__ import absolute_import
import json
-import collections
from .base import ischema_names, colspecs
from ... import types as sqltypes
@@ -61,7 +60,7 @@ class JSONPathType(sqltypes.JSON.JSONPathType):
super_proc = self.string_bind_processor(dialect)
def process(value):
- assert isinstance(value, collections.Sequence)
+ assert isinstance(value, util.collections_abc.Sequence)
tokens = [util.text_type(elem)for elem in value]
value = "{%s}" % (", ".join(tokens))
if super_proc:
@@ -74,7 +73,7 @@ class JSONPathType(sqltypes.JSON.JSONPathType):
super_proc = self.string_literal_processor(dialect)
def process(value):
- assert isinstance(value, collections.Sequence)
+ assert isinstance(value, util.collections_abc.Sequence)
tokens = [util.text_type(elem)for elem in value]
value = "{%s}" % (", ".join(tokens))
if super_proc:
diff --git a/lib/sqlalchemy/engine/result.py b/lib/sqlalchemy/engine/result.py
index ed6c0251d..d4c862375 100644
--- a/lib/sqlalchemy/engine/result.py
+++ b/lib/sqlalchemy/engine/result.py
@@ -179,8 +179,7 @@ class RowProxy(BaseRowProxy):
try:
# Register RowProxy with Sequence,
# so sequence protocol is implemented
- from collections import Sequence
- Sequence.register(RowProxy)
+ util.collections_abc.Sequence.register(RowProxy)
except ImportError:
pass
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py
index 9c79ccf7a..5c884e1a0 100644
--- a/lib/sqlalchemy/sql/base.py
+++ b/lib/sqlalchemy/sql/base.py
@@ -14,7 +14,6 @@ from .. import util, exc
import itertools
from .visitors import ClauseVisitor
import re
-import collections
PARSE_AUTOCOMMIT = util.symbol('PARSE_AUTOCOMMIT')
NO_ARG = util.symbol('NO_ARG')
@@ -46,7 +45,7 @@ def _generative(fn, *args, **kw):
return self
-class _DialectArgView(collections.MutableMapping):
+class _DialectArgView(util.collections_abc.MutableMapping):
"""A dictionary view of dialect-level arguments in the form
<dialectname>_<argument_name>.
@@ -99,7 +98,7 @@ class _DialectArgView(collections.MutableMapping):
)
-class _DialectArgDict(collections.MutableMapping):
+class _DialectArgDict(util.collections_abc.MutableMapping):
"""A dictionary view of dialect-level arguments for a specific
dialect.
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py
index 08af78606..ef0de2a92 100644
--- a/lib/sqlalchemy/sql/sqltypes.py
+++ b/lib/sqlalchemy/sql/sqltypes.py
@@ -2098,7 +2098,7 @@ class JSON(Indexable, TypeEngine):
@util.dependencies('sqlalchemy.sql.default_comparator')
def _setup_getitem(self, default_comparator, index):
if not isinstance(index, util.string_types) and \
- isinstance(index, collections.Sequence):
+ isinstance(index, compat.collections_abc.Sequence):
index = default_comparator._check_literal(
self.expr, operators.json_path_getitem_op,
index, bindparam_type=JSON.JSONPathType