Skip to content

Commit

Permalink
Merge pull request capstone-engine#638 from SeanHeelan/issue-634
Browse files Browse the repository at this point in the history
__getattr__ should raise AttributeError, not return None, on failure
  • Loading branch information
aquynh committed Apr 18, 2016
2 parents 7ed1988 + 1e608ef commit 06ee5a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/python/capstone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,12 +567,12 @@ def __getattr__(self, name):

attr = object.__getattribute__
if not attr(self, '_cs')._detail:
return None
raise AttributeError(name)
_dict = attr(self, '__dict__')
if 'operands' not in _dict:
self.__gen_detail()
if name not in _dict:
return None
raise AttributeError(name)
return _dict[name]

# get the last error code
Expand Down

0 comments on commit 06ee5a7

Please sign in to comment.