Skip to content

Commit 8e5a15b

Browse files
authored
Call startswith once with a tuple (#8998)
2 parents f3b05d6 + 9d5ea82 commit 8e5a15b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

setup.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _find_library_dirs_ldconfig() -> list[str]:
163163
args: list[str]
164164
env: dict[str, str]
165165
expr: str
166-
if sys.platform.startswith("linux") or sys.platform.startswith("gnu"):
166+
if sys.platform.startswith(("linux", "gnu")):
167167
if struct.calcsize("l") == 4:
168168
machine = os.uname()[4] + "-32"
169169
else:
@@ -623,11 +623,7 @@ def build_extensions(self) -> None:
623623

624624
for extension in self.extensions:
625625
extension.extra_compile_args = ["-Wno-nullability-completeness"]
626-
elif (
627-
sys.platform.startswith("linux")
628-
or sys.platform.startswith("gnu")
629-
or sys.platform.startswith("freebsd")
630-
):
626+
elif sys.platform.startswith(("linux", "gnu", "freebsd")):
631627
for dirname in _find_library_dirs_ldconfig():
632628
_add_directory(library_dirs, dirname)
633629
if sys.platform.startswith("linux") and os.environ.get("ANDROID_ROOT"):

0 commit comments

Comments
 (0)