Use proper main_thread API from Python 3.4
# limitations under the License.
import sys
-from threading import current_thread
+from threading import current_thread, main_thread
import signal
from robot.errors import ExecutionFailed
@@ -57,7 +57,7 @@ class _StopSignalMonitor:
@property
def _can_register_signal(self):
- return signal and current_thread().name == 'MainThread'
+ return signal and current_thread() is main_thread()
def _register_signal_handler(self, signum):
try:
