[Python-modules-commits] [gerritlib] 01/02: Fix python3 compatibility by decoding bytes to string
Filip Pytloun
fpytloun-guest at moszumanska.debian.org
Wed Dec 13 14:49:00 UTC 2017
This is an automated email from the git hooks/post-receive script.
fpytloun-guest pushed a commit to branch master
in repository gerritlib.
commit 83cb9c5e5a85737481128a0b04a5cc15fa0c2e9b
Author: Filip Pytloun <filip at pytloun.cz>
Date: Wed Dec 13 15:48:15 2017 +0100
Fix python3 compatibility by decoding bytes to string
---
gerritlib/gerrit.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gerritlib/gerrit.py b/gerritlib/gerrit.py
index 5730aac..cf3cedf 100644
--- a/gerritlib/gerrit.py
+++ b/gerritlib/gerrit.py
@@ -408,12 +408,16 @@ class Gerrit(object):
stdin, stdout, stderr = client.exec_command(command)
out = stdout.read()
+ if type(out) == bytes:
+ out = out.decode()
self.log.debug("SSH received stdout:\n%s" % out)
ret = stdout.channel.recv_exit_status()
self.log.debug("SSH exit status: %s" % ret)
err = stderr.read()
+ if type(err) == bytes:
+ err = err.decode()
self.log.debug("SSH received stderr:\n%s" % err)
if ret:
raise Exception("Gerrit error executing %s" % command)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/gerritlib.git
More information about the Python-modules-commits
mailing list