From 2d2fa49130249f757f6f1100dad879e1071ad385 Mon Sep 17 00:00:00 2001 From: xtreak Date: Mon, 24 Sep 2018 12:23:54 -0400 Subject: Import from collections.abc Fixed additional warnings generated by Python 3.7 due to changes in the organization of the Python ``collections`` and ``collections.abc`` packages. Previous ``collections`` warnings were fixed in version 1.2.11. Pull request courtesy xtreak. See I2d1c0ef97c8ecac7af152cc56263422a40faa6bb for the original collections.abc fixes. Fixes: #4339 Change-Id: Ia92d2461f20309fb33ea6c6f592f7d4e7e32ae7a Pull-request: https://github.com/zzzeek/sqlalchemy/pull/475 --- lib/sqlalchemy/dialects/postgresql/json.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/json.py') 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: -- cgit v1.2.1