Skip to content

Commit 19581bf

Browse files
committed
nodename error resolved
1 parent 684c7df commit 19581bf

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

lib/analytics.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,27 @@ def __init__(self):
99

1010
@staticmethod
1111
def finding_address():
12-
val = get_mac()
13-
return val
12+
try:
13+
val = get_mac()
14+
return val
15+
16+
except Exception as e :
17+
return None
1418

1519
@staticmethod
1620
def finding_ip():
17-
val = socket.gethostbyname(socket.gethostname())
18-
return val
21+
try:
22+
val = socket.gethostbyname(socket.gethostname())
23+
return val
24+
except Exception as e:
25+
return None
1926

2027
@staticmethod
2128
def finding_system():
22-
return platform.system()
23-
29+
try:
30+
return platform.system()
31+
except Exception as e:
32+
return None
2433
def __setitem__(self, key, val):
2534
self.dict[key] = val
2635

0 commit comments

Comments
 (0)