Skip to content

Commit

Permalink
Changed __dict__ access to vars() calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Worrell committed May 21, 2015
1 parent b6dd48c commit 2f9ace9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stix/common/vocabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def from_dict(cls, vocab_dict, return_obj=None):

def _get_terms(vocab_class):
"""Helper function used by register_vocab."""
for k, v in vocab_class.__dict__.items():
for k, v in vars(vocab_class).items():
if k.startswith("TERM_"):
yield v

Expand Down
2 changes: 1 addition & 1 deletion stix/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def iter_vars(obj):
def check(name):
return name not in ('__input_namespaces__', '__input_schemalocations__')

instance_vars = obj.__dict__.iteritems()
instance_vars = vars(obj).iteritems()
return ((attr_name(name), val) for name, val in instance_vars if check(name))


Expand Down
2 changes: 1 addition & 1 deletion stix/utils/walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _iter_vars(obj):
attrs = []

if hasattr(obj, "__dict__"):
attrs.append(obj.__dict__.iteritems())
attrs.append(vars(obj).iteritems())

if hasattr(obj, "_fields"):
attrs.append(obj._fields.iteritems())
Expand Down

0 comments on commit 2f9ace9

Please sign in to comment.