Commits

Vinay Sajip committed 029fee5

Used dummy_threading when threading isn't available.

Comments (0)

Files changed (5)

 import shutil
 import subprocess
 import tempfile
-from threading import Thread
+try:
+    from threading import Thread
+except ImportError:
+    from dummy_threading import Thread
 
 from distlib import DistlibException
 from distlib.compat import (HTTPBasicAuthHandler, Request, HTTPPasswordMgr,

distlib/locators.py

 import os
 import posixpath
 import re
-import threading
+try:
+    import threading
+except ImportError:
+    import dummy_threading as threading
 import zlib
 
 from . import DistlibException
 import sys
 import tarfile
 import tempfile
-import threading
+try:
+    import threading
+except ImportError:
+    import dummy_threading as threading
 import time
 
 from . import DistlibException
 import ssl
 import sys
 import tempfile
-import threading
+try:
+    import threading
+except ImportError:
+    import dummy_threading as threading
 import weakref
 
 from compat import (unittest, HTTPServer as BaseHTTPServer,

tests/test_index.py

 import subprocess
 import sys
 import tempfile
-import threading
+try:
+    import threading
+except ImportError:
+    import dummy_threading as threading
 
 from compat import unittest, Request
 from support import HTTPSServerThread