Issue 4290: 2to3 fails with sympy (original) (raw)

Download my branch of sympy from here:

http://github.com/certik/sympy/tree/division3

and run the 2to3 tool with python2.5:

$ python2.5 ../2to3/2to3 sympy/ [...] Traceback (most recent call last): File "../2to3/2to3", line 6, in sys.exit(main("lib2to3.fixes")) File "/home/ondra/repos/2to3/lib2to3/main.py", line 126, in main rt.refactor(args, options.write, options.doctests_only) File "/home/ondra/repos/2to3/lib2to3/refactor.py", line 194, in refactor self.refactor_dir(dir_or_file, write, doctests_only) File "/home/ondra/repos/2to3/lib2to3/refactor.py", line 212, in refactor_dir self.refactor_file(fullname, write, doctests_only) File "/home/ondra/repos/2to3/lib2to3/refactor.py", line 235, in refactor_file tree = self.refactor_string(input, filename) File "/home/ondra/repos/2to3/lib2to3/refactor.py", line 260, in refactor_string self.refactor_tree(tree, name) File "/home/ondra/repos/2to3/lib2to3/refactor.py", line 299, in refactor_tree self.traverse_by(self.post_order, tree.post_order()) File "/home/ondra/repos/2to3/lib2to3/refactor.py", line 323, in traverse_by new = fixer.transform(node, results) File "/home/ondra/repos/2to3/lib2to3/fixes/fix_metaclass.py", line 148, in transform if not has_metaclass(node): File "/home/ondra/repos/2to3/lib2to3/fixes/fix_metaclass.py", line 34, in has_metaclass return has_metaclass(node) File "/home/ondra/repos/2to3/lib2to3/fixes/fix_metaclass.py", line 39, in has_metaclass if leaf_node.value == 'metaclass': AttributeError: 'Node' object has no attribute 'value'