1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-12 02:04:04 +02:00

Remove superfluous parens

This commit is contained in:
2022-08-31 12:05:33 +02:00
parent 3296fd8d89
commit 6d891d7488
6 changed files with 7 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ class Checker:
if line[0:12] == "-----END PGP": if line[0:12] == "-----END PGP":
break break
line = line.rstrip() line = line.rstrip()
if (line[0] == '='): if line[0] == '=':
crc = line[1:] crc = line[1:]
line = fd.readline() line = fd.readline()
break break

View File

@@ -6942,7 +6942,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
command = args[0] 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.') raise oscerr.WrongArgs('Wrong command given.')
if command == "remoterun" or command == "rr": 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)): or inspect.ismodule(data)):
setattr(self.__class__, name, data) setattr(self.__class__, name, data)
except (SyntaxError, NameError, ImportError) as e: 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) print("%s: %s\n" % (os.path.join(plugin_dir, extfile), e), file=sys.stderr)
else: else:
import traceback import traceback

View File

@@ -44,7 +44,7 @@ class MockRequest:
return self.headers.get(header_name, default) return self.headers.get(header_name, default)
def has_header(self, header_name): 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): def add_unredirected_header(self, key, val):
# modifies the `headers` variable that was passed to object's constructor # modifies the `headers` variable that was passed to object's constructor

View File

@@ -6862,7 +6862,7 @@ def owner(apiurl, search_term=None, mode="binary", attribute=None,
""" """
# binary is just for API backward compatibility # 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') raise ValueError('Either specify search_term or binary')
elif binary is not None: elif binary is not None:
search_term = binary search_term = binary

View File

@@ -169,7 +169,7 @@ class Ar:
if data != b'!<arch>': if data != b'!<arch>':
raise ArError(self.filename, 'no ar archive') raise ArError(self.filename, 'no ar archive')
pos = 8 pos = 8
while (len(data) != 0): while len(data) != 0:
self.__file.seek(pos, os.SEEK_SET) self.__file.seek(pos, os.SEEK_SET)
data = self.__file.read(self.hdr_len) data = self.__file.read(self.hdr_len)
if not data: if not data:

View File

@@ -153,7 +153,7 @@ class CpioRead:
if not self.format in self.sfmt.values(): if not self.format in self.sfmt.values():
raise CpioError(self.filename, '\'%s\' is not a supported cpio format' % self.format) raise CpioError(self.filename, '\'%s\' is not a supported cpio format' % self.format)
pos = 0 pos = 0
while (len(data) != 0): while len(data) != 0:
self.__file.seek(pos, os.SEEK_SET) self.__file.seek(pos, os.SEEK_SET)
data = self.__file.read(self.hdr_len) data = self.__file.read(self.hdr_len)
if not data: if not data: