Skip to content

Commit

Permalink
platform module: Fixes interpreter version recognition
Browse files Browse the repository at this point in the history
the previous, human-oriented approach based on Guido's
unmaterialized thought to continue with a version 4 after 3.9.
  • Loading branch information
funkyfuture committed Aug 9, 2023
1 parent 1818381 commit d906152
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cerberus/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@
raise RuntimeError("Cerberus can't be run with Python's optimization level 2.")


PYTHON_VERSION = float(sys.version_info[0]) + float(sys.version_info[1]) / 10


if PYTHON_VERSION < 3:
if sys.version_info < (3,):
_int_types = (int, long) # noqa: F821
_str_type = basestring # noqa: F821
else:
_int_types = (int,)
_str_type = str


if PYTHON_VERSION < 3.3:
if sys.version_info < (3, 3):
from collections import (
Callable,
Container,
Expand All @@ -42,7 +39,7 @@
Sized,
)

if PYTHON_VERSION < 3.8:
if sys.version_info < (3, 8):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
Expand Down

0 comments on commit d906152

Please sign in to comment.