PythonCharmers / python-future

Easy, clean, reliable Python 2/3 compatibility
http://python-future.org
MIT License
1.17k stars 291 forks source link

modified fix_unpacking.py for use in both python versions 2/3 #599

Closed slycordinator closed 4 months ago

slycordinator commented 2 years ago

Changed fix_unpacking.py to use:

For me, this fixed the issue referenced in https://github.com/PythonCharmers/python-future/issues/549

slycordinator commented 2 years ago

Though, for brevity, you may prefer something more like:

try:
    pre = unicode(num_pre)
    post = unicode(num_post)
except NameError:
    pre = str(num_pre)
    post = str(num_post)

Which seems to work the same.

edschofield commented 4 months ago

Thanks for the fix, @slycordinator !