Author: Ronan Lamy <[email protected]>
Branch: py3tests
Changeset: r94060:86424558bdc9
Date: 2018-03-21 23:49 +0100
http://bitbucket.org/pypy/pypy/changeset/86424558bdc9/
Log: Remove costly collections import from ast_util
diff --git a/pypy/tool/pytest/ast-rewriter/ast_util.py
b/pypy/tool/pytest/ast-rewriter/ast_util.py
--- a/pypy/tool/pytest/ast-rewriter/ast_util.py
+++ b/pypy/tool/pytest/ast-rewriter/ast_util.py
@@ -1,8 +1,6 @@
"""Utilities for assertion debugging"""
from __future__ import absolute_import, division, print_function
-from collections import Sequence
-
u = str
# The _reprcompare attribute on the util module is used by the new assertion
@@ -102,7 +100,7 @@
summary = u('%s %s %s') % (left_repr, op, right_repr)
def issequence(x):
- return isinstance(x, Sequence) and not isinstance(x, basestring)
+ return hasattr(x, '__iter__') and not isinstance(x, basestring)
def istext(x):
return isinstance(x, basestring)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit