Search Results

Search found 3 results on 1 pages for 'py2to3'.

Page 1/1 | 1 

  • 2to3 fixer to convert try .. except .. block

    - by Sridhar Ratnakumar
    I have a Python2 project with lots of try .. except .. blocks like this: try: [...] except SomeException, e: # do something with `e` To port them all to Python 3 (and still have the code run Python =2.6), I have to manually change each and every one of them to the following: try: [...] except SomeException, e: _, e, _ = sys.exc_info() # do something with `e` Can this be automated using 2to3? If so, how?

    Read the article

  • use/run python's 2to3 as or like a unittest

    - by Vincent
    I have used the 2to3 utility to convert code from the command line. What I would like to do is run it basically as a unittest. Even if it tests the file rather than parts(funtions, methods...) as would be normal for a unittest. It does not need to be a unittest and I don't what to automatically convert the files I just want to monitor the py3 compliance of files in a unittest like manor. I can't seem to find any documentation or examples for this. An example and/or documentation would be great. Thanks

    Read the article

1