File tree 2 files changed +9
-2
lines changed 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,11 @@ This list is detailed and covers changes in each pre-release version.
22
22
Unreleased
23
23
----------
24
24
25
- Nothing yet.
25
+ - Fix: a signal handler was being set from multiple threads, causing an error:
26
+ ``ValueError: signal only works in main thread ``. This is now fixed, closing
27
+ `issue 1312 `_.
28
+
29
+ .. _issue 1312 : https://github.com/nedbat/coveragepy/issues/1312
26
30
27
31
28
32
.. _changes_63 :
Original file line number Diff line number Diff line change 11
11
import platform
12
12
import signal
13
13
import sys
14
+ import threading
14
15
import time
15
16
import warnings
16
17
@@ -528,8 +529,10 @@ def _init_for_start(self):
528
529
# It's useful to write debug info after initing for start.
529
530
self ._should_write_debug = True
530
531
532
+ # Register our clean-up handlers.
531
533
atexit .register (self ._atexit )
532
- if not env .WINDOWS :
534
+ is_main = (threading .current_thread () == threading .main_thread ())
535
+ if is_main and not env .WINDOWS :
533
536
# The Python docs seem to imply that SIGTERM works uniformly even
534
537
# on Windows, but that's not my experience, and this agrees:
535
538
# https://stackoverflow.com/questions/35772001/x/35792192#35792192
You can’t perform that action at this time.
0 commit comments