Skip to content

Commit

Permalink
Fix pylint suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
andersgs committed Mar 17, 2023
1 parent 5778347 commit 5e27cab
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/vezzo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_version_string(cmd: str, version_flag: str, exit_code: int) -> str:
in it.
"""
cmd = [cmd, version_flag]
chk_output = True if exit_code == 0 else False
chk_output = exit_code == 0
try:
process = subprocess.run(
cmd,
Expand All @@ -111,12 +111,11 @@ def get_version_string(cmd: str, version_flag: str, exit_code: int) -> str:
)
if len(process.stdout) > 0:
return process.stdout
elif len(process.stderr) > 0:
if len(process.stderr) > 0:
return process.stderr
else:
raise UnableToGenerateVersionOutputString(
f"Invalid output with command {' '.join(cmd)}"
)
raise UnableToGenerateVersionOutputString(
f"Invalid output with command {' '.join(cmd)}"
)

except subprocess.CalledProcessError as error:
raise error
Expand Down

0 comments on commit 5e27cab

Please sign in to comment.