Skip to content

Commit 97d9c5f

Browse files
committed
More fixes for: DeprecationWarning: Using or importing the ABCs from
'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
1 parent dc3bee7 commit 97d9c5f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

roundup/cgi/PageTemplates/Expressions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
for Python expressions, string literals, and paths.
2323
"""
2424

25-
import collections, re, sys
25+
import re, sys
26+
try:
27+
from collections.abc import Callable
28+
except ImportError:
29+
from collections import Callable
30+
2631
from .TALES import Engine, CompilerError, _valid_name, NAME_RE, \
2732
Undefined, Default, _parse_expr
2833

@@ -86,7 +91,7 @@ def render(ob, ns):
8691
ob = call_with_ns(ob.__render_with_namespace__, ns)
8792
else:
8893
base = ob
89-
if isinstance(base, collections.Callable):
94+
if isinstance(base, Callable):
9095
try:
9196
if getattr(base, 'isDocTemp', 0):
9297
ob = call_with_ns(ob, ns, 2)

0 commit comments

Comments
 (0)