Skip to content

Commit d05da78

Browse files
committed
Import ABC from collections.abc for Python 3.
1 parent aa5b0d6 commit d05da78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rethinkdb/ast.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import base64
2222
import binascii
23-
import collections
23+
import collections.abc
2424
import datetime
2525
import json
2626
import threading
@@ -74,7 +74,7 @@ def expr(val, nesting_depth=20):
7474

7575
if isinstance(val, RqlQuery):
7676
return val
77-
elif isinstance(val, collections.Callable):
77+
elif isinstance(val, collections.abc.Callable):
7878
return Func(val)
7979
elif isinstance(val, (datetime.datetime, datetime.date)):
8080
if not hasattr(val, "tzinfo") or not val.tzinfo:
@@ -95,14 +95,14 @@ def expr(val, nesting_depth=20):
9595
return Datum(val)
9696
elif isinstance(val, bytes):
9797
return Binary(val)
98-
elif isinstance(val, collections.Mapping):
98+
elif isinstance(val, collections.abc.Mapping):
9999
# MakeObj doesn't take the dict as a keyword args to avoid
100100
# conflicting with the `self` parameter.
101101
obj = {}
102102
for k, v in dict_items(val):
103103
obj[k] = expr(v, nesting_depth - 1)
104104
return MakeObj(obj)
105-
elif isinstance(val, collections.Iterable):
105+
elif isinstance(val, collections.abc.Iterable):
106106
val = [expr(v, nesting_depth - 1) for v in val]
107107
return MakeArray(*val)
108108
else:

0 commit comments

Comments
 (0)