From 12bac8a55d7ef25ae8403c1aad98186b335ded8a Mon Sep 17 00:00:00 2001 From: Chengzhong Wu Date: Fri, 28 Jun 2024 18:16:34 +0100 Subject: [PATCH] chore: fix ruff command --- .github/workflows/python_tests.yml | 2 +- pylib/gyp/xcodeproj_file.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index f66f3bd6..1140ef2c 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -31,7 +31,7 @@ jobs: pip install --editable ".[dev]" - run: ./gyp -V && ./gyp --version && gyp -V && gyp --version - name: Lint with ruff # See pyproject.toml for settings - run: ruff --output-format=github . + run: ruff check --output-format=github . - name: Test with pytest # See pyproject.toml for settings run: pytest # - name: Run doctests with pytest diff --git a/pylib/gyp/xcodeproj_file.py b/pylib/gyp/xcodeproj_file.py index 33c667c2..4f92cd09 100644 --- a/pylib/gyp/xcodeproj_file.py +++ b/pylib/gyp/xcodeproj_file.py @@ -781,7 +781,7 @@ def UpdateProperties(self, properties, do_copy=False): # Make sure the property conforms to the schema. (is_list, property_type, is_strong) = self._schema[property][0:3] if is_list: - if value.__class__ != list: + if not isinstance(value.__class__, list): raise TypeError( property + " of " @@ -791,7 +791,7 @@ def UpdateProperties(self, properties, do_copy=False): ) for item in value: if not isinstance(item, property_type) and not ( - isinstance(item, str) and property_type == str + isinstance(item, str) and isinstance(property_type, str) ): # Accept unicode where str is specified. str is treated as # UTF-8-encoded. @@ -806,7 +806,7 @@ def UpdateProperties(self, properties, do_copy=False): + item.__class__.__name__ ) elif not isinstance(value, property_type) and not ( - isinstance(value, str) and property_type == str + isinstance(value, str) and isinstance(property_type, str) ): # Accept unicode where str is specified. str is treated as # UTF-8-encoded.