def start_new_thread(function, args, kwargs={}):
 if (type(args) != type(tuple())):
  raise TypeError('2nd arg must be a tuple')
 if (type(kwargs) != type(dict())):
  raise TypeError('3rd arg must be a dict')
 global _main
 _main = False
 try:
  function(*args, **kwargs)
 except SystemExit:
  pass
 except:
  _traceback.print_exc()
 _main = True
 global _interrupt
 if _interrupt:
  _interrupt = False
  raise KeyboardInterrupt

def start_new_thread ( function , args , kwargs = { } ) : if ( type ( args ) != type ( tuple ( ) ) ) : raise TypeError ( '2nd arg must be a tuple' ) if ( type ( kwargs ) != type ( dict ( ) ) ) : raise TypeError ( '3rd arg must be a dict' ) global _main _main = False try : function ( * args , ** kwargs ) except SystemExit : pass except : _traceback . print_exc ( ) _main = True global _interrupt if _interrupt : _interrupt = False raise KeyboardInterrupt
dummy implementation of _thread .