mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 02:36:17 +03:00
Use os.getlogin() instead of whoami command for getting username
This commit is contained in:
parent
a8b3feac86
commit
7b157b045a
|
@ -149,7 +149,7 @@ def grabclipboard():
|
||||||
loginctl = None
|
loginctl = None
|
||||||
|
|
||||||
if loginctl is not None:
|
if loginctl is not None:
|
||||||
username = subprocess.check_output("whoami").decode().strip("\n")
|
username = os.getlogin()
|
||||||
sessionid = [
|
sessionid = [
|
||||||
line.split()[0] for line in loginctl if username in line.split()
|
line.split()[0] for line in loginctl if username in line.split()
|
||||||
][0]
|
][0]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user