mirror of https://github.com/n1nj4sec/pupy.git
os.getuid() is not supported by windows
This commit is contained in:
parent
a8ea635599
commit
7ac9ab73b5
|
@ -143,7 +143,13 @@ class PStore(object):
|
|||
return cls._instance
|
||||
|
||||
def __init__(self, pstore_dir='~'):
|
||||
seed = '{}:{}'.format(os.getuid(), uuid.getnode())
|
||||
try:
|
||||
import getpass
|
||||
uid = getpass.getuser()
|
||||
except:
|
||||
uid = os.getuid()
|
||||
|
||||
seed = '{}:{}'.format(uid, uuid.getnode())
|
||||
|
||||
h = hashlib.sha1()
|
||||
h.update(seed)
|
||||
|
|
Loading…
Reference in New Issue