There was an error while loading. Please reload this page.
1 parent c4b7b34 commit 504141bCopy full SHA for 504141b
1 file changed
dirlock/__init__.py
@@ -20,9 +20,17 @@
20
# keep a list of currently acquired locks
21
# so these can be cleaned up on exit
22
_allActiveLocks = set()
23
-# we don't want to call the original handler
24
-original_sigint_handler = signal.getsignal(signal.SIGINT)
25
-original_sigterm_handler = signal.getsignal(signal.SIGTERM)
+
+# we don't want to miss the original handler
+try:
26
+ original_sigint_handler = signal.getsignal(signal.SIGINT)
27
+except Exception:
28
+ pass
29
30
31
+ original_sigterm_handler = signal.getsignal(signal.SIGTERM)
32
33
34
35
36
# function to clean up all active locks
0 commit comments