Skip to content

Commit

Permalink
Python 3: CsError.__str__
Browse files Browse the repository at this point in the history
Choose `CsError.__str__` implementation based on Python version.
  • Loading branch information
Raijinili committed Dec 1, 2015
1 parent dba3492 commit b0c5436
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bindings/python/capstone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,13 @@ class CsError(Exception):
def __init__(self, errno):
self.errno = errno

def __str__(self):
return _cs.cs_strerror(self.errno)
if _python2:
def __str__(self):
return _cs.cs_strerror(self.errno)

else:
def __str__(self):
return _cs.cs_strerror(self.errno).decode()


# return the core's version
Expand Down

0 comments on commit b0c5436

Please sign in to comment.