[New-bugs-announce] [issue4290] 2to3 fails with sympy

Ondrej Certik report at bugs.python.org
Mon Nov 10 00:04:13 CET 2008


New submission from Ondrej Certik <ondrej at certik.cz>:

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 <module>
    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'

----------
messages: 75669
nosy: certik
severity: normal
status: open
title: 2to3 fails with sympy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4290>
_______________________________________


More information about the New-bugs-announce mailing list