mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-20 04:24:21 -04:00
Just realized Windows is a supported OS. This should be more portable.
This commit is contained in:
parent
91d0bb4fda
commit
0e5b182a54
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue