parameters: (modList)
docstring: Force every module in modList to be placed into main
docstring_summary: Force every module in modList to be placed into main
docstring_tokens: Force every module in modList to be placed into main
function: def _modules_to_main(modList):
      """Force every module in modList to be placed into main"""
      if not modList:
          return
  
      main = sys.modules['__main__']
      for modname in modList:
          if type(modname) is str:
              try:
                  mod = __import__(modname)
              except Exception as e:
                  sys.stderr.write('warning: could not import %s\n.  '
                                   'Your function may unexpectedly error due to this import failing;'
                                   'A version mismatch is likely.  Specific error was:\n' % modname)
                  print_exec(sys.stderr)
              else:
                  setattr(main, mod.__name__, mod)
function_tokens: def _modules_to_main ( modList ) : if not modList : return main = sys . modules [ '__main__' ] for modname in modList : if type ( modname ) is str : try : mod = __import__ ( modname ) except Exception as e : sys . stderr . write ( 'warning: could not import %s\n.  ' 'Your function may unexpectedly error due to this import failing;' 'A version mismatch is likely.  Specific error was:\n' % modname ) print_exec ( sys . stderr ) else : setattr ( main , mod . __name__ , mod )