From 4d7c180d8fade09b636f2715483548bad2690203 Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:14:16 +0100 Subject: [PATCH] checks misuse of sys.version_info (manual) ruff 'YTT' --- ruff-strict-pep8.toml | 2 +- src/odf/opendocument.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruff-strict-pep8.toml b/ruff-strict-pep8.toml index 2c73e0fe95..297c7084e4 100644 --- a/ruff-strict-pep8.toml +++ b/ruff-strict-pep8.toml @@ -18,7 +18,7 @@ quote-style = 'single' [lint] ignore = ['E402', 'E722', 'E741', 'UP012', 'UP030', 'UP032', 'UP038'] -select = ['E', 'F', 'I', 'W', 'INT', 'Q', 'UP'] +select = ['E', 'F', 'I', 'W', 'INT', 'Q', 'UP', 'YTT'] [lint.per-file-ignores] "recipes/*" = ['UP'] diff --git a/src/odf/opendocument.py b/src/odf/opendocument.py index d947230502..6d1365b90f 100644 --- a/src/odf/opendocument.py +++ b/src/odf/opendocument.py @@ -65,7 +65,7 @@ UNIXPERMS = 0o100644 << 16 # -rw-r--r-- IS_FILENAME = 0 IS_IMAGE = 1 # We need at least Python 2.2 -assert sys.version_info[0]>=2 and sys.version_info[1] >= 2 +assert sys.version_info >= (2, 2) # sys.setrecursionlimit(100) # The recursion limit is set conservative so mistakes like