Skip to content

Commit

Permalink
Merge pull request #599 from slycordinator/fix_unpacking.py
Browse files Browse the repository at this point in the history
modified fix_unpacking.py for use in both python versions 2/3
  • Loading branch information
edschofield authored Feb 21, 2024
2 parents 0c347ff + 8e5ea18 commit de68c10
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libpasteurize/fixes/fix_unpacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ def assignment_source(num_pre, num_post, LISTNAME, ITERNAME):
Returns a source fit for Assign() from fixer_util
"""
children = []
pre = unicode(num_pre)
post = unicode(num_post)
try:
pre = unicode(num_pre)
post = unicode(num_post)
except NameError:
pre = str(num_pre)
post = str(num_post)
# This code builds the assignment source from lib2to3 tree primitives.
# It's not very readable, but it seems like the most correct way to do it.
if num_pre > 0:
Expand Down

0 comments on commit de68c10

Please sign in to comment.