mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 23:12:46 +03:00
force_exit() to make exit work with all fdroid build
conditions
The build command has to use some threading stuff to handle the timeout and locks. This seems to prevent the command from exiting, unless this hack is used.
This commit is contained in:
parent
568256f75c
commit
1f346b3149
3 changed files with 19 additions and 10 deletions
|
@ -3424,3 +3424,16 @@ def calculate_math_string(expr):
|
|||
raise SyntaxError("could not parse expression '{expr}', "
|
||||
"only basic math operations are allowed (+, -, *)"
|
||||
.format(expr=expr))
|
||||
|
||||
|
||||
def force_exit(exitvalue=0):
|
||||
"""force exit when thread operations could block the exit
|
||||
|
||||
The build command has to use some threading stuff to handle the
|
||||
timeout and locks. This seems to prevent the command from
|
||||
exiting, unless this hack is used.
|
||||
|
||||
"""
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
os._exit(exitvalue)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue