adjusted exit handling to python 3
This commit is contained in:
parent
121f6def82
commit
fc153ba08f
1 changed files with 16 additions and 6 deletions
|
@ -32,6 +32,14 @@ _ffbin = None # ffmpeg binary, if set to None it is searched in your $PATH
|
||||||
# Main Program, no changes needed below this line
|
# Main Program, no changes needed below this line
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
|
|
||||||
|
# Global Variables
|
||||||
|
|
||||||
|
mda = None
|
||||||
|
mdv = None
|
||||||
|
afifo = None
|
||||||
|
vfifo = None
|
||||||
|
|
||||||
|
# Main Function
|
||||||
def main(argv):
|
def main(argv):
|
||||||
"""Main Function, cli argument processing and checking"""
|
"""Main Function, cli argument processing and checking"""
|
||||||
|
|
||||||
|
@ -238,14 +246,16 @@ def cleanup():
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
try:
|
try:
|
||||||
os.kill(mda.pid())
|
if (mda != None):
|
||||||
os.kill(mdv.pid())
|
os.kill(mda.pid())
|
||||||
|
if (mdv != None):
|
||||||
|
os.kill(mdv.pid())
|
||||||
finally:
|
finally:
|
||||||
try:
|
if (afifo != None):
|
||||||
os.remove(afifo)
|
os.remove(afifo)
|
||||||
|
if (vfifo != None):
|
||||||
os.remove(vfifo)
|
os.remove(vfifo)
|
||||||
finally:
|
os._exit(0)
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
"""Print avaiable commandline arguments"""
|
"""Print avaiable commandline arguments"""
|
||||||
|
@ -262,7 +272,7 @@ def usage():
|
||||||
print(" --threads <num> [-t]: Use <num> Threads to encode")
|
print(" --threads <num> [-t]: Use <num> Threads to encode")
|
||||||
print(" --force-overwrite [-f]: Overwrite output-file if existing")
|
print(" --force-overwrite [-f]: Overwrite output-file if existing")
|
||||||
print(" --help [-h]: Print this Help")
|
print(" --help [-h]: Print this Help")
|
||||||
sys.exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
|
||||||
# Start the Main Function
|
# Start the Main Function
|
||||||
|
|
Loading…
Reference in a new issue