mirror of
https://github.com/beetbox/beets.git
synced 2026-01-07 08:32:06 +01:00
switch basestring for bytes in HumanReadableException
We already check for unicode first, so this shouldn't cause any issues on py2
This commit is contained in:
parent
66431ab4de
commit
33d451ed2d
1 changed files with 1 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ class HumanReadableException(Exception):
|
|||
"""Get the reason as a string."""
|
||||
if isinstance(self.reason, unicode):
|
||||
return self.reason
|
||||
elif isinstance(self.reason, basestring): # Byte string.
|
||||
elif isinstance(self.reason, bytes):
|
||||
return self.reason.decode('utf8', 'ignore')
|
||||
elif hasattr(self.reason, 'strerror'): # i.e., EnvironmentError
|
||||
return self.reason.strerror
|
||||
|
|
|
|||
Loading…
Reference in a new issue