mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 14:53:06 +02:00
Linux binary build: Return proper exit codes when raising SystemExit
This commit is contained in:
parent
527c33bb0d
commit
8265e95b15
1 changed files with 7 additions and 2 deletions
|
|
@ -386,8 +386,13 @@ def main():
|
|||
mod = __import__(sys.calibre_module, fromlist=[1])
|
||||
func = getattr(mod, sys.calibre_function)
|
||||
return func()
|
||||
except SystemExit:
|
||||
raise
|
||||
except SystemExit as err:
|
||||
if err.code is None:
|
||||
return 0
|
||||
if isinstance(err.code, int):
|
||||
return err.code
|
||||
print (err.code)
|
||||
return 1
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
|
|
|||
Loading…
Reference in a new issue