Skip to content

Commit b289d74

Browse files
Apply refurb suggestions
[FURB108]: Use `x in (y, z)` instead of `x == y or x == z`
1 parent f7ff2d0 commit b289d74

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

distutils/command/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def _expand_attrs(self, attrs):
609609
for attr in attrs:
610610
val = getattr(self, attr)
611611
if val is not None:
612-
if os.name == 'posix' or os.name == 'nt':
612+
if os.name in ('posix', 'nt'):
613613
val = os.path.expanduser(val)
614614
val = subst_vars(val, self.config_vars)
615615
setattr(self, attr, val)

distutils/cygwinccompiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def gcc_version(self):
133133

134134
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
135135
"""Compiles the source by spawning GCC and windres if needed."""
136-
if ext == '.rc' or ext == '.res':
136+
if ext in ('.rc', '.res'):
137137
# gcc needs '.res' and '.rc' compiled to object files !!!
138138
try:
139139
self.spawn(["windres", "-i", src, "-o", obj])

distutils/msvc9compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def initialize(self, plat_name=None): # noqa: C901
391391
# to cross compile, you use 'x86_amd64'.
392392
# On AMD64, 'vcvars32.bat amd64' is a native build env; to cross
393393
# compile use 'x86' (ie, it runs the x86 compiler directly)
394-
if plat_name == get_platform() or plat_name == 'win32':
394+
if plat_name in (get_platform(), 'win32'):
395395
# native build or cross-compile to win32
396396
plat_spec = PLAT_TO_VCVARS[plat_name]
397397
else:

distutils/text_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def readline(self): # noqa: C901
255255

256256
# blank line (whether we rstrip'ed or not)? skip to next line
257257
# if appropriate
258-
if (line == '' or line == '\n') and self.skip_blanks:
258+
if line in ('', '\n') and self.skip_blanks:
259259
continue
260260

261261
if self.join_lines:

0 commit comments

Comments
 (0)