Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python2 is not supported
#1
i am now writing most of my scripts for Python3. is it reasonable to test which version of python is actually running and search for Python3 and if found, re-run the script under the intended version of python?

if not, then is it reasonable to raise an exception (instead of exiting with a status code)? if so, what class of exception should i raise?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
I would raise a RuntimeError
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
If your code only supports python 3, the python version is not something it should be checking at all.

Instead, specify the python 3 requirement in your setup.py, mention it in your readme, mention it in your docs.
That should be enough. If people still try using it with python 2, it's their problem.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to run a python2 script dagamer1991 3 2,485 Aug-12-2019, 12:33 PM
Last Post: buran
  python2.7 executables thus the system python2.7 was erroring utility.execute()? vivekm 1 1,727 May-20-2019, 11:24 AM
Last Post: vivekm

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020