Skip to content

Commit f1221f4

Browse files
authored
Don't split manually on linebreaks (#209)
Co-authored-by: Steven Silvester <steven.silvester@ieee.org> Fixes #84
1 parent 3ae2b82 commit f1221f4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

terminado/tests/basic_test.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ async def get_pid(self):
117117
assert match is not None
118118
pid = int(match.groups()[0])
119119
else:
120-
pid = int(stdout.split("\n")[1])
120+
# This should work on any OS, but keeping the above Windows special
121+
# case as I can't verify on Windows.
122+
for li in stdout.splitlines():
123+
if re.match(r"\d+$", li):
124+
pid = int(li)
125+
break
121126
return pid
122127

123128
def close(self):

0 commit comments

Comments
 (0)