Pull requests

#1 Merged
Repository
singingwolfboy singingwolfboy
Branch
default
Repository
antocuni antocuni
Branch
default

Python 2.5 compatibility

Author
  1. David Baumgold
Reviewers
Description

using "except Exception, e" breaks compatibility with Python3. If we want compatibility with both py2.5 and py3, I fear the only way is to use the ugly "except Exception: e = sys.exc_info()[1]"

  • Learn about pull requests

Comments (5)

  1. David Baumgold author

    Which is terrible for many different reasons. Do you want to just drop Python 2.5 compatibility? (I'm packaging this project for Macports, and I'm perfectly happy to automatically patch that line if the module is installed for Python 2.5.)

    1. Antonio Cuni repo owner

      yes, I would prefer not to have the exc_info() hack, and if I have to choose between py25 and py3 compatibility, I'd prefer py3 (because I actually need it :-)). Automatically patching the line sounds like a good idea. Maybe we could even use 3to2 to automatize it, although I heve zero experience with it.

      1. David Baumgold author

        Alright, if you pull in all the *other* changes in this commit, tag a new release, and push it to PyPI, then I can use that release in Macports and auto-patch that line. Thanks!