Skip to content

Commit 85643c1

Browse files
committed
2 parents 45d6c64 + de68c10 commit 85643c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/libpasteurize/fixes/fix_unpacking.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ def assignment_source(num_pre, num_post, LISTNAME, ITERNAME):
1818
Returns a source fit for Assign() from fixer_util
1919
"""
2020
children = []
21-
pre = unicode(num_pre)
22-
post = unicode(num_post)
21+
try:
22+
pre = unicode(num_pre)
23+
post = unicode(num_post)
24+
except NameError:
25+
pre = str(num_pre)
26+
post = str(num_post)
2327
# This code builds the assignment source from lib2to3 tree primitives.
2428
# It's not very readable, but it seems like the most correct way to do it.
2529
if num_pre > 0:

0 commit comments

Comments
 (0)