faulthandler: fix compilating without threads
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index 59a0a6d..bfe662e 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -8,6 +8,12 @@
 import tempfile
 import unittest
 
+try:
+    import threading
+    HAVE_THREADS = True
+except ImportError:
+    HAVE_THREADS = False
+
 TIMEOUT = 0.5
 
 try:
@@ -279,6 +285,7 @@
         with temporary_filename() as filename:
             self.check_dump_traceback(filename)
 
+    @unittest.skipIf(not HAVE_THREADS, 'need threads')
     def check_dump_traceback_threads(self, filename):
         """
         Call explicitly dump_traceback(all_threads=True) and check the output.