Skip to content

Commit bf6972e

Browse files
author
Thomas Preud'homme
committed
[LNT] Python 3 support: requests.response as text
Summary: lnt admin rm-machine command prints output from the REST API for deleting machine line by line using requests.response's iter_lines() method. However in Python 3 this method returns data by default and printing expects a string. This commit uses the text attribute for requests.response and iterate over the lines with splitlines. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls, leandron, PrzemekWirkus Reviewed By: PrzemekWirkus Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68985
1 parent 6000111 commit bf6972e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lnt/lnttool/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def action_rm_machine(config, machine):
186186
.format(machine=machine, **config.dict))
187187
response = config.session.delete(url, stream=True)
188188
_check_response(response)
189-
for line in response.iter_lines():
189+
for line in response.text.splitlines():
190190
sys.stdout.write(line + '\n')
191191
sys.stdout.flush()
192192

0 commit comments

Comments
 (0)