Skip to content

Commit

Permalink
script exits with 0 status when called with --version/--help (#109)
Browse files Browse the repository at this point in the history
finally clause in _main() function was blocking argparse behaviour of exiting
with 0 status code when those options are used.
  • Loading branch information
gaetano-guerriero authored and nicfit committed Oct 31, 2017
1 parent 19e29cd commit 6916b24
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/eyed3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ def parseCommandLine(cmd_line_args=None):

def _main():
"""Entry point"""
retval = 1

try:
args, _, config = parseCommandLine()

Expand All @@ -285,6 +283,7 @@ def _main():
except Exception as ex:
eyed3.utils.console.printError("Uncaught exception: %s\n" % str(ex))
eyed3.log.exception(ex)
retval = 1

if args.debug_pdb:
try:
Expand All @@ -298,8 +297,8 @@ def _main():

e, m, tb = sys.exc_info()
pdb.post_mortem(tb)
finally:
sys.exit(retval)

sys.exit(retval)


if __name__ == "__main__": # pragma: no cover
Expand Down

0 comments on commit 6916b24

Please sign in to comment.