py3 compat for mtp on unix error reporting

This commit is contained in:
Kovid Goyal 2021-01-18 08:04:44 +05:30
parent 05776164d0
commit 0bdaf44cfb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -206,8 +206,7 @@ class MTP_DEVICE(MTPDeviceBase):
self.dev = self._filesystem_cache = None
def format_errorstack(self, errs):
return '\n'.join(['%d:%s'%(code, msg.decode('utf-8', 'replace')) for
code, msg in errs])
return '\n'.join('%d:%s'%(code, as_unicode(msg)) for code, msg in errs)
@synchronous
def open(self, connected_device, library_uuid):