()
Ensure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
Ensure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
Ensure that os . environ has all the environment variables we guarantee that users can use in config files command - line options etc . Currently this includes : HOME - user s home directory ( Unix only ) PLAT - description of the current platform including hardware and OS ( see get_platform () )
def check_environ ():
    """Ensure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    """
    global _environ_checked
    if _environ_checked:
        return

    if os.name == 'posix' and 'HOME' not in os.environ:
        try:
            import pwd
            os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
        except (ImportError, KeyError):
            # bpo-10496: if the current user identifier doesn't exist in the
            # password database, do nothing
            pass

    if 'PLAT' not in os.environ:
        os.environ['PLAT'] = get_platform()

    _environ_checked = 1
def check_environ ( ) : global _environ_checked if _environ_checked : return if os . name == 'posix' and 'HOME' not in os . environ : try : import pwd os . environ [ 'HOME' ] = pwd . getpwuid ( os . getuid ( ) ) [ 5 ] except ( ImportError , KeyError ) : # bpo-10496: if the current user identifier doesn't exist in the # password database, do nothing pass if 'PLAT' not in os . environ : os . environ [ 'PLAT' ] = get_platform ( ) _environ_checked = 1