We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 861fee3 + db0137c commit b8e9cf1Copy full SHA for b8e9cf1
safeeyes/__main__.py
@@ -40,6 +40,7 @@
40
def __running():
41
"""Check if SafeEyes is already running."""
42
process_count = 0
43
+ current_user = psutil.Process().username()
44
for proc in psutil.process_iter():
45
if not proc.cmdline:
46
continue
@@ -54,9 +55,10 @@ def __running():
54
55
if ("python3" in cmd_line[0] or "python" in cmd_line[0]) and (
56
"safeeyes" in cmd_line[1] or "safeeyes" in cmd_line
57
):
- process_count += 1
58
- if process_count > 1:
59
- return True
+ if proc.username() == current_user:
+ process_count += 1
60
+ if process_count > 1:
61
+ return True
62
63
# Ignore if process does not exist or does not have command line args
64
except (IndexError, psutil.NoSuchProcess):
0 commit comments