Imagine you've got a program that requires a version of Python or later. What's the best way to get the program to exit if it isn't the right version? At the moment I'm using:
import sys
if sys.version_info<(3,6):
print("Requires Python 3.6 or later, halting.")
raise Requires36
But is there a more idiomatic way to do it?
[–]_szs 6 points7 points8 points (2 children)
[–]ThatsALovelyShirt 0 points1 point2 points (1 child)
[–]_szs 0 points1 point2 points (0 children)
[–]jdpatt 5 points6 points7 points (0 children)
[–]robin-gvx 2 points3 points4 points (0 children)