Commit 85c22055 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update limbra_status.py to handle SystemExit error

parent ef8c79c1
......@@ -27,18 +27,17 @@
EXAMPLE
> cd ...limbra/scripts
> run -S test_limbra script status.py
> run script test_limbra script status.py
> run loop path_to_dburis status.py
AUTHOR
R. Le Gac -- Jul 2017
R. Le Gac -- Jul 2017 - 2021
"""
import json
import sys
if __name__ == "__main__":
def cli():
data = dict()
......@@ -71,7 +70,7 @@ if __name__ == "__main__":
if len(publications) == 0:
print(json.dumps(data))
sys.exit(0)
return
data["publications"] = publications
......@@ -115,4 +114,19 @@ if __name__ == "__main__":
# output and exit
#
print(json.dumps(data))
sys.exit(0)
if __name__ == "__main__":
import traceback
try:
cli()
# NOTE:
# capture traceback produced on all sys.exit() even sys.exit(0)
# happen with web2py 2.20.4 running with python 3.8.5
except SystemExit as e:
if e.code != 0:
traceback.print_tb(e.__traceback__)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment