def start_new_thread(function, args, kwargs={}):
if type(args) != type(tuple()):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if type(kwargs) != type(dict()):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>global _main<EOL>_main = False<EOL>try:<EOL><INDENT>function(*args, **kwargs)<EOL><DEDENT>except SystemExit:<EOL><INDENT>pass<EOL><DEDENT>except:<EOL><INDENT>_traceback.print_exc()<EOL><DEDENT>_main = True<EOL>global _interrupt<EOL>if _interrupt:<EOL><INDENT>_interrupt = False<EOL>raise KeyboardInterrupt<EOL><DEDENT>
Dummy implementation of thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.