jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/620285 )
Change subject: [IMPR] Use Popen.communicate in favour of Popen.stdin.write
......................................................................
[IMPR] Use Popen.communicate in favour of Popen.stdin.write
https://docs.python.org/3.5/library/subprocess.html#subprocess.Popen.commun…
Change-Id: I551f06c5c2f67efafad835ff6b3934b22276e686
---
M tests/utils.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
D3r1ck01: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/utils.py b/tests/utils.py
index e1d9075..0bea97d 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -600,11 +600,11 @@
stdin=PIPE if data_in is not None else None)
if data_in is not None:
- p.stdin.write(data_in.encode(config.console_encoding))
- p.stdin.flush() # _communicate() otherwise has a broken pipe
+ data_in = data_in.encode(config.console_encoding)
try:
- stdout_data, stderr_data = p.communicate(timeout=timeout)
+ stdout_data, stderr_data = p.communicate(input=data_in,
+ timeout=timeout)
except TimeoutExpired:
p.kill()
stdout_data, stderr_data = p.communicate()
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/620285
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I551f06c5c2f67efafad835ff6b3934b22276e686
Gerrit-Change-Number: 620285
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged