summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2019-10-10 13:20:30 -0700
committerLee Duncan <lduncan@suse.com>2019-10-10 13:20:30 -0700
commit6bd06da03df0ee65b57f9d3095c5b1d12ef7291f (patch)
tree38bdd283bf0d9df58bf879f23f220b11c36b5b97 /scripts
parent5db46b16377b18063366433f192d36bb3fb1e8df (diff)
downloadtargetcli-6bd06da03df0ee65b57f9d3095c5b1d12ef7291f.tar.gz
Handle Python 3.7 stricter binary vs. string rules.
We can no longer have python automatically convert binary to/from string data, so be explicit about it. Also, the TargetCLI __del__ method was testing for a non-existant attribute, so close our socket if open.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/targetcli5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/targetcli b/scripts/targetcli
index b7a2467..cb97b2b 100755
--- a/scripts/targetcli
+++ b/scripts/targetcli
@@ -151,7 +151,7 @@ def call_daemon(shell, req):
while amount_received < amount_expected:
data = sock.recv(1024)
amount_received += len(data)
- print(data, end ="")
+ print(data.decode(), end ="")
sock.send(b'-END@OF@DATA-')
sock.close()
@@ -218,7 +218,8 @@ def main():
use_daemon = True
if use_daemon:
- call_daemon(shell, get_arguments())
+ call_daemon(shell, get_arguments().encode())
+ # does not return
try:
root_node = UIRoot(shell, as_root=is_root)