import multiprocessing import queue # or Queue in Python 2 f = multiprocessing.Queue() try: f.get(True,0.1) except queue.Empty: # queue here refers to the module, not a class print('foo')