def import_helper(mod_name):
 try:
  sys.stdout = STDOUT_FAKE
  __import__(mod_name)
 finally:
  sys.stdout = STDOUT_BAK

def import_helper ( mod_name ) : try : sys . stdout = STDOUT_FAKE __import__ ( mod_name ) finally : sys . stdout = STDOUT_BAK
helper function used to temporarily override stdout before importing a module .