mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Just realized Windows is a supported OS. This should be more portable.
This commit is contained in:
parent
91d0bb4fda
commit
0e5b182a54
@ -306,8 +306,9 @@ def tails_root():
|
|||||||
|
|
||||||
def register_cleanup_handler(directory):
|
def register_cleanup_handler(directory):
|
||||||
import signal
|
import signal
|
||||||
|
import shutil
|
||||||
def handler(signum = None, frame = None):
|
def handler(signum = None, frame = None):
|
||||||
subprocess.call(['rm','-r',directory])
|
shutil.rmtree(directory)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]:
|
for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]:
|
||||||
signal.signal(sig, handler)
|
signal.signal(sig, handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user