Skip to content

Commit 1aa27d5

Browse files
hroncokfrenzymadness
authored andcommitted
Use universal_newlines with Popen, get strs, not bytes
1 parent 4e96150 commit 1aa27d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/parse_ifconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def __init__(self, stdout=None, debug=False):
7373
else:
7474
env = os.environ.copy()
7575
env.update(LANG='C.utf8')
76-
p = Popen('ifconfig', stdout=PIPE, stderr=PIPE, env=env)
76+
p = Popen('ifconfig', stdout=PIPE, stderr=PIPE,
77+
env=env, universal_newlines=True)
7778
self.stdout, self.stderr = p.communicate()
7879
if self.stderr != '':
7980
raise ValueError('stderr from ifconfig was nonempty:\n%s' % self.stderr)

0 commit comments

Comments
 (0)