
Dec. 2, 2002
7:36 a.m.
try: import threading except ImportError: threading = None # use non-threaded behaviour
But then you'd have to sprinkle the rest of the code with "if threading is not None" tests. Brett's dummy_thread is an attempt to reduce this clutter. I've been known to write a mini-version of dummy_thread.py in code to minimize the clutter; it seems useful to generalize this. --Guido van Rossum (home page: http://www.python.org/~guido/)