def import_pywin32_module(module_name):
 module = None
 try:
  module = __import__(name=module_name, globals={}, locals={}, fromlist=[''])
 except ImportError as exc:
  if str(exc).startswith('No system module'):
   is_sys_frozen = hasattr(sys, 'frozen')
   sys_frozen = getattr(sys, 'frozen', None)
   sys.frozen = '|_|GLYH@CK'
   if compat.is_venv:
    sys_paths = sys.path
   else:
    import site
    sys_paths = site.getsitepackages()
   for sys_path in sys_paths:
    pywin32_dll_dir = os.path.join(sys_path, 'pywin32_system32')
    if os.path.isdir(pywin32_dll_dir):
     sys.path.append(pywin32_dll_dir)
     try:
      module = __import__(name=module_name, globals={}, locals={}, fromlist=[''])
      break
     except ImportError:
      pass
   if is_sys_frozen:
    sys.frozen = sys_frozen
   else:
    del sys.frozen
  if (module is None):
   raise
 return module

def import_pywin32_module ( module_name ) : module = None try : module = __import__ ( name = module_name , globals = { } , locals = { } , fromlist = [ '' ] ) except ImportError as exc : if str ( exc ) . startswith ( 'No system module' ) : is_sys_frozen = hasattr ( sys , 'frozen' ) sys_frozen = getattr ( sys , 'frozen' , None ) sys . frozen = '|_|GLYH@CK' if compat . is_venv : sys_paths = sys . path else : import site sys_paths = site . getsitepackages ( ) for sys_path in sys_paths : pywin32_dll_dir = os . path . join ( sys_path , 'pywin32_system32' ) if os . path . isdir ( pywin32_dll_dir ) : sys . path . append ( pywin32_dll_dir ) try : module = __import__ ( name = module_name , globals = { } , locals = { } , fromlist = [ '' ] ) break except ImportError : pass if is_sys_frozen : sys . frozen = sys_frozen else : del sys . frozen if ( module is None ) : raise return module
import and return the pywin32 module with the passed name .