Checking compatibility of a script across Python versionsautomatically

A

Andrew Berg

Are there any tools out there that will parse a script and tell me if it
is compatible with an arbitrary version of Python and highlight any
incompatibilities? I need to check a few of my scripts that target 3.2
to see if I can make them compatible with 3.0 and 3.1 if they aren't
already. I found pyqver, but it isn't accurate (at least for 3.2/3.3
scripts) and hasn't been updated in 2 years. I could look over the docs
and do it manually, but one of the scripts isn't small, so I'd prefer
not to.
 
S

Steven D'Aprano

Are there any tools out there that will parse a script and tell me if it
is compatible with an arbitrary version of Python and highlight any
incompatibilities? I need to check a few of my scripts that target 3.2
to see if I can make them compatible with 3.0 and 3.1 if they aren't
already. I found pyqver, but it isn't accurate (at least for 3.2/3.3
scripts) and hasn't been updated in 2 years. I could look over the docs
and do it manually, but one of the scripts isn't small, so I'd prefer
not to.

You could try running it and see if it breaks. That usually works for
me :)

For anything except throw-away scripts, I prefer to write scripts with a
"self-test" option so that I (or any other user) can run the test and see
if it works without actually using it for production work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,707
Messages
2,569,344
Members
44,635
Latest member
Matt231

Latest Threads

Top