Skip to content

Commit ce4c99e

Browse files
authored
Merge pull request #2334 from smurfix/sig
Closes #2333
2 parents 591b4af + 55af19e commit ce4c99e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

newsfragments/2333.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Python raises a `TypeError` if you try to (re-)install a C signal handler.

trio/_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def is_main_thread():
7878
try:
7979
signal.signal(signal.SIGINT, signal.getsignal(signal.SIGINT))
8080
return True
81-
except ValueError:
81+
except (TypeError, ValueError):
8282
return False
8383

8484

0 commit comments

Comments
 (0)