diff --git a/osc/checker.py b/osc/checker.py index ee7712be..66ee8871 100644 --- a/osc/checker.py +++ b/osc/checker.py @@ -69,7 +69,7 @@ class Checker: if line[0:12] == "-----END PGP": break line = line.rstrip() - if (line[0] == '='): + if line[0] == '=': crc = line[1:] line = fd.readline() break diff --git a/osc/commandline.py b/osc/commandline.py index f7cb86f0..67806109 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6942,7 +6942,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. command = args[0] - if not (command in ( 'runall', 'ra', 'run', 'localrun', 'manualrun', 'disabledrun', 'remoterun', 'lr', 'dr', 'mr', 'rr', 'merge', 'wait' )): + if command not in ('runall', 'ra', 'run', 'localrun', 'manualrun', 'disabledrun', 'remoterun', 'lr', 'dr', 'mr', 'rr', 'merge', 'wait'): raise oscerr.WrongArgs('Wrong command given.') if command == "remoterun" or command == "rr": @@ -9327,7 +9327,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. or inspect.ismodule(data)): setattr(self.__class__, name, data) except (SyntaxError, NameError, ImportError) as e: - if (os.environ.get('OSC_PLUGIN_FAIL_IGNORE')): + if os.environ.get('OSC_PLUGIN_FAIL_IGNORE'): print("%s: %s\n" % (os.path.join(plugin_dir, extfile), e), file=sys.stderr) else: import traceback diff --git a/osc/connection.py b/osc/connection.py index 6516c2f8..c0b4440a 100644 --- a/osc/connection.py +++ b/osc/connection.py @@ -44,7 +44,7 @@ class MockRequest: return self.headers.get(header_name, default) def has_header(self, header_name): - return (header_name in self.headers) + return header_name in self.headers def add_unredirected_header(self, key, val): # modifies the `headers` variable that was passed to object's constructor diff --git a/osc/core.py b/osc/core.py index 527b9106..48917280 100644 --- a/osc/core.py +++ b/osc/core.py @@ -6862,7 +6862,7 @@ def owner(apiurl, search_term=None, mode="binary", attribute=None, """ # binary is just for API backward compatibility - if not ((search_term is None) ^ (binary is None)): + if not (search_term is None) ^ (binary is None): raise ValueError('Either specify search_term or binary') elif binary is not None: search_term = binary diff --git a/osc/util/ar.py b/osc/util/ar.py index db800d7b..8cf2d1be 100644 --- a/osc/util/ar.py +++ b/osc/util/ar.py @@ -169,7 +169,7 @@ class Ar: if data != b'!': raise ArError(self.filename, 'no ar archive') pos = 8 - while (len(data) != 0): + while len(data) != 0: self.__file.seek(pos, os.SEEK_SET) data = self.__file.read(self.hdr_len) if not data: diff --git a/osc/util/cpio.py b/osc/util/cpio.py index 1f706e99..f84f2749 100644 --- a/osc/util/cpio.py +++ b/osc/util/cpio.py @@ -153,7 +153,7 @@ class CpioRead: if not self.format in self.sfmt.values(): raise CpioError(self.filename, '\'%s\' is not a supported cpio format' % self.format) pos = 0 - while (len(data) != 0): + while len(data) != 0: self.__file.seek(pos, os.SEEK_SET) data = self.__file.read(self.hdr_len) if not data: