From: <pj...@us...> - 2008-12-06 09:02:57
|
Revision: 5714 http://jython.svn.sourceforge.net/jython/?rev=5714&view=rev Author: pjenvey Date: 2008-12-06 09:02:53 +0000 (Sat, 06 Dec 2008) Log Message: ----------- revert the astlist workaround as it subclasses list now Modified Paths: -------------- trunk/jython/Lib/test/test_ast.py Modified: trunk/jython/Lib/test/test_ast.py =================================================================== --- trunk/jython/Lib/test/test_ast.py 2008-12-06 06:55:48 UTC (rev 5713) +++ trunk/jython/Lib/test/test_ast.py 2008-12-06 09:02:53 UTC (rev 5714) @@ -5,7 +5,7 @@ def to_tuple(t): if t is None or isinstance(t, (basestring, int, long, complex)): return t - elif hasattr(t, "__iter__"): + elif isinstance(t, list): return [to_tuple(e) for e in t] result = [t.__class__.__name__] if hasattr(t, 'lineno') and hasattr(t, 'col_offset'): @@ -131,7 +131,7 @@ parent_pos = (ast_node.lineno, ast_node.col_offset) for name in ast_node._fields: value = getattr(ast_node, name) - if hasattr(value, "__iter__"): + if isinstance(value, list): for child in value: self._assert_order(child, parent_pos) elif value is not None: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |