Skip to content

Commit 20ee088

Browse files
committed
rework get_username
1 parent 5d759b5 commit 20ee088

File tree

1 file changed

+9
-12
lines changed
  • Raspberry_Pi_Severance_MDR_Terminal

1 file changed

+9
-12
lines changed

Raspberry_Pi_Severance_MDR_Terminal/lumon.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,15 @@
2727
LOCATION = "Cold Harbor"
2828

2929
def get_username():
30-
try:
31-
username = os.environ.get('USER')
32-
if username:
33-
return username
34-
username = os.environ.get('LOGNAME')
35-
if username:
36-
return username
37-
username = os.environ.get('USERNAME')
38-
if username:
39-
return username
40-
except Exception:
41-
pass
30+
username = os.environ.get('USER')
31+
if username:
32+
return username
33+
username = os.environ.get('LOGNAME')
34+
if username:
35+
return username
36+
username = os.environ.get('USERNAME')
37+
if username:
38+
return username
4239
return "Mark S."
4340

4441
def generate_serial_number(username):

0 commit comments

Comments
 (0)