Skip to content
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

Commit f24beca

Browse files
author
Vitor Serpa
committed
Fix python version comparison
1 parent 68e0fa9 commit f24beca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas_dev_flaker/_ast_helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ def check_for_wrong_alias(
3636
def is_str_constant(
3737
node: ast.Call,
3838
) -> bool:
39-
python_version = float(sys.version_info.major) + 0.1 * float(
40-
sys.version_info.minor,
41-
)
4239
return isinstance(node.func, ast.Attribute) and (
43-
(python_version < 3.8 and isinstance(node.func.value, ast.Str))
40+
(
41+
sys.version_info[0:2] < (3, 8)
42+
and isinstance(node.func.value, ast.Str)
43+
)
4444
or (
45-
python_version >= 3.8
45+
sys.version_info[0:2] >= (3, 8)
4646
and isinstance(node.func.value, ast.Constant)
4747
and isinstance(node.func.value.value, str)
4848
)

0 commit comments

Comments
 (0)