Skip to content

Commit

Permalink
__dir__ doesn't exist in python 2
Browse files Browse the repository at this point in the history
Thanks jezdez for reporting! Closes elastic#107
  • Loading branch information
honzakral committed Mar 24, 2015
1 parent 0d8261d commit 8d4e1a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elasticsearch_dsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __setitem__(self, key, value):
self._d_[key] = value

def __setattr__(self, name, value):
if name in self._d_ or name not in super(AttrDict, self).__dir__():
if name in self._d_ or not hasattr(self.__class__, name):
self._d_[name] = value
else:
# there is an attribute on the class (could be property, ..) - don't add it as field
Expand Down

0 comments on commit 8d4e1a0

Please sign in to comment.