Skip to content

Commit

Permalink
Fix Python version logic that would fail with Py 4 (Netflix#792)
Browse files Browse the repository at this point in the history
Fix error discovered by https://github.com/asottile/flake8-2020

% `flake8 . --count --select=E9,F63,F7,F82,Y --show-source --statistics`
```
./metaflow/metaflow/util.py:53:36: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple
if sys.version_info.major >= 3 and sys.version_info.minor >= 7:
                                   ^
```
  • Loading branch information
cclauss authored Oct 29, 2021
1 parent 5186c6c commit db20d4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metaflow/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def unquote_bytes(x):

from shlex import quote as _quote

if sys.version_info.major >= 3 and sys.version_info.minor >= 7:
if sys.version_info >= (3, 7):
from collections import namedtuple

namedtuple_with_defaults = namedtuple
Expand Down

0 comments on commit db20d4e

Please sign in to comment.