Skip to content

pasteurize: NameError: name 'unicode' is not defined #549

Closed
@oliver-batchelor

Description

@oliver-batchelor

pasteurize (from anaconda) has a runtime error.

(base) ➜  tools git:(master) ✗ pasteurize --version
0.18.2


(base) ➜  tools git:(master) ✗ pasteurize -w __init__.py
Traceback (most recent call last):
  File "/home/oliver/miniconda3/bin/pasteurize", line 11, in <module>
    sys.exit(main())
  File "/home/oliver/miniconda3/lib/python3.7/site-packages/libpasteurize/main.py", line 195, in main
    options.processes)
  File "/home/oliver/miniconda3/lib/python3.7/lib2to3/refactor.py", line 687, in refactor
    items, write, doctests_only)
  File "/home/oliver/miniconda3/lib/python3.7/lib2to3/refactor.py", line 282, in refactor
    self.refactor_file(dir_or_file, write, doctests_only)
  File "/home/oliver/miniconda3/lib/python3.7/lib2to3/refactor.py", line 728, in refactor_file
    *args, **kwargs)
  File "/home/oliver/miniconda3/lib/python3.7/lib2to3/refactor.py", line 335, in refactor_file
    tree = self.refactor_string(input, filename)
  File "/home/oliver/miniconda3/lib/python3.7/lib2to3/refactor.py", line 367, in refactor_string
    self.refactor_tree(tree, name)
  File "/home/oliver/miniconda3/lib/python3.7/lib2to3/refactor.py", line 407, in refactor_tree
    self.traverse_by(self.bmi_post_order_heads, tree.post_order())
  File "/home/oliver/miniconda3/lib/python3.7/lib2to3/refactor.py", line 483, in traverse_by
    new = fixer.transform(node, results)
  File "/home/oliver/miniconda3/lib/python3.7/site-packages/libpasteurize/fixes/fix_unpacking.py", line 101, in transform
    setup_line, power_line = self.fix_explicit_context(node, results)
  File "/home/oliver/miniconda3/lib/python3.7/site-packages/libpasteurize/fixes/fix_unpacking.py", line 61, in fix_explicit_context
    power_line = Assign(target, assignment_source(len(pre), len(post), self.LISTNAME, self.ITERNAME))
  File "/home/oliver/miniconda3/lib/python3.7/site-packages/libpasteurize/fixes/fix_unpacking.py", line 21, in assignment_source
    pre = unicode(num_pre)
NameError: name 'unicode' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions