Fix ping module with LANG fixed to C
This commit is contained in:
parent
f3c539ad78
commit
e828091c25
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from i3pystatus import IntervalModule
|
from i3pystatus import IntervalModule
|
||||||
@ -62,7 +63,7 @@ class Ping(IntervalModule):
|
|||||||
def ping_host(self):
|
def ping_host(self):
|
||||||
p = subprocess.Popen(["ping", "-c1", "-w%d" % self.interval,
|
p = subprocess.Popen(["ping", "-c1", "-w%d" % self.interval,
|
||||||
self.host], stdout=subprocess.PIPE,
|
self.host], stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.DEVNULL)
|
stderr=subprocess.DEVNULL, env=dict(os.environ, LC_ALL="C"))
|
||||||
out, _ = p.communicate()
|
out, _ = p.communicate()
|
||||||
if p.returncode == 0:
|
if p.returncode == 0:
|
||||||
return float(out.decode().split("\n")[1]
|
return float(out.decode().split("\n")[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user