Fall back to getuid if geteuid is not available
It appears to be missing in PyPy3
This commit is contained in:
parent
8ae3d2aeaf
commit
c617dbe6d8
|
@ -134,8 +134,13 @@ except ImportError:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from getpass import getuser as _get_user
|
from getpass import getuser as _get_user
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
|
from os import geteuid as getuid
|
||||||
|
except ImportError:
|
||||||
|
from os import getuid
|
||||||
|
|
||||||
def _get_user():
|
def _get_user():
|
||||||
return pwd.getpwuid(os.geteuid()).pw_name
|
return pwd.getpwuid(getuid()).pw_name
|
||||||
|
|
||||||
|
|
||||||
username = False
|
username = False
|
||||||
|
|
Loading…
Reference in New Issue