This repository was archived by the owner on Feb 4, 2024. It is now read-only.
This repository was archived by the owner on Feb 4, 2024. It is now read-only.
version_info.major >= 3 and version_info.minor >= 5 #8
Closed
Description
This is used in three places in scipy, and I've seen this sort of thing in other repos too:
if sys.version_info.major >= 3 and sys.version_info.minor >= 5:
from math import gcd
else:
from fractions import gcd
The if
is incorrectly False
for 4.0 - 4.4, 5.0 - 5.4, etc.
To fix:
-if sys.version_info.major >= 3 and sys.version_info.minor >= 5:
+if sys.version_info >= (3, 5):
from math import gcd
else:
from fractions import gcd
Can this easily be detected?