Skip to content

Commit

Permalink
fix trivial 2.6 incompatibility
Browse files Browse the repository at this point in the history
https://docs.python.org/2/library/stdtypes.html?highlight=decode#str.decode

Changed in version 2.7: Support for keyword arguments added.

Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
  • Loading branch information
Pierre Tardy committed Oct 2, 2014
1 parent 8b72fb0 commit f43ca6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions master/buildbot/steps/slave.py
Expand Up @@ -158,10 +158,10 @@ def commandComplete(self, cmd):
def getResultSummary(self):
src = self.src
if isinstance(src, str):
src = src.decode('ascii', errors='replace')
src = src.decode('ascii', 'replace')
dest = self.dest
if isinstance(dest, str):
dest = dest.decode('ascii', errors='replace')
dest = dest.decode('ascii', 'replace')
copy = u"%s to %s" % (src, dest)
if self.results == SUCCESS:
rv = u'Copied ' + copy
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/util/__init__.py
Expand Up @@ -313,7 +313,7 @@ def command_to_string(command):

# cmd was a comand and thus probably a bytestring. Be gentle in
# trying to covert it.
rv = rv.decode('ascii', errors='replace')
rv = rv.decode('ascii', 'replace')

return rv

Expand Down

0 comments on commit f43ca6b

Please sign in to comment.