From d05da78812d24dd3555237986465514077396fe6 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Tue, 21 Apr 2020 13:53:38 +0000 Subject: [PATCH] Import ABC from collections.abc for Python 3. --- rethinkdb/ast.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rethinkdb/ast.py b/rethinkdb/ast.py index 73e76e1a..284ca05a 100644 --- a/rethinkdb/ast.py +++ b/rethinkdb/ast.py @@ -20,7 +20,7 @@ import base64 import binascii -import collections +import collections.abc import datetime import json import threading @@ -74,7 +74,7 @@ def expr(val, nesting_depth=20): if isinstance(val, RqlQuery): return val - elif isinstance(val, collections.Callable): + elif isinstance(val, collections.abc.Callable): return Func(val) elif isinstance(val, (datetime.datetime, datetime.date)): if not hasattr(val, "tzinfo") or not val.tzinfo: @@ -95,14 +95,14 @@ def expr(val, nesting_depth=20): return Datum(val) elif isinstance(val, bytes): return Binary(val) - elif isinstance(val, collections.Mapping): + elif isinstance(val, collections.abc.Mapping): # MakeObj doesn't take the dict as a keyword args to avoid # conflicting with the `self` parameter. obj = {} for k, v in dict_items(val): obj[k] = expr(v, nesting_depth - 1) return MakeObj(obj) - elif isinstance(val, collections.Iterable): + elif isinstance(val, collections.abc.Iterable): val = [expr(v, nesting_depth - 1) for v in val] return MakeArray(*val) else: