def _get_home():
 try:
  if ((not PY3min) and (sys.platform == 'win32')):
   path = os.path.expanduser('~').decode(sys.getfilesystemencoding())
  else:
   path = os.path.expanduser('~')
 except ImportError:
  pass
 else:
  if os.path.isdir(path):
   return path
 for evar in ('HOME', 'USERPROFILE', 'TMP'):
  path = os.environ.get(evar)
  if ((path is not None) and os.path.isdir(path)):
   return path
 return None

def _get_home ( ) : try : if ( ( not PY3min ) and ( sys . platform == 'win32' ) ) : path = os . path . expanduser ( '~' ) . decode ( sys . getfilesystemencoding ( ) ) else : path = os . path . expanduser ( '~' ) except ImportError : pass else : if os . path . isdir ( path ) : return path for evar in ( 'HOME' , 'USERPROFILE' , 'TMP' ) : path = os . environ . get ( evar ) if ( ( path is not None ) and os . path . isdir ( path ) ) : return path return None
find users home directory if possible .