From 390356bb5e22ff2b9500247ac86108dbe5dda919 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sat, 22 Nov 2025 14:54:44 +0100 Subject: [PATCH] Apply ruff/flake8-pie rule PIE810 PIE810 Call `startswith` once with a `tuple` PIE810 Call `endswith` once with a `tuple` --- testing/cffi1/test_cffi_binary.py | 2 +- testing/cffi1/test_zdist.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/testing/cffi1/test_cffi_binary.py b/testing/cffi1/test_cffi_binary.py index 2fb042cee..84668bb12 100644 --- a/testing/cffi1/test_cffi_binary.py +++ b/testing/cffi1/test_cffi_binary.py @@ -17,7 +17,7 @@ def test_no_unknown_exported_symbols(): if '*UND*' in line: continue name = line.split()[-1] - if name.startswith('_') or name.startswith('.'): + if name.startswith(('_', '.')): continue # a statically-linked libffi will always appear here without header hackage, ignore it if it's internal if name.startswith('ffi_') and 'Base' in line: diff --git a/testing/cffi1/test_zdist.py b/testing/cffi1/test_zdist.py index d8200e7e9..f8ab74fa7 100644 --- a/testing/cffi1/test_zdist.py +++ b/testing/cffi1/test_zdist.py @@ -70,8 +70,7 @@ def check_produced_files(self, content, curdir=None): curdir = str(self.udir) found_so = None for name in os.listdir(curdir): - if (name.endswith('.so') or name.endswith('.pyd') or - name.endswith('.dylib') or name.endswith('.dll')): + if (name.endswith(('.so', '.pyd', '.dylib', '.dll'))): found_so = os.path.join(curdir, name) # foo.so => foo parts = name.split('.')