Skip to content

Commit 2f9ace9

Browse files
author
Bryan Worrell
committed
Changed __dict__ access to vars() calls.
1 parent b6dd48c commit 2f9ace9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

stix/common/vocabs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def from_dict(cls, vocab_dict, return_obj=None):
149149

150150
def _get_terms(vocab_class):
151151
"""Helper function used by register_vocab."""
152-
for k, v in vocab_class.__dict__.items():
152+
for k, v in vars(vocab_class).items():
153153
if k.startswith("TERM_"):
154154
yield v
155155

stix/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def iter_vars(obj):
251251
def check(name):
252252
return name not in ('__input_namespaces__', '__input_schemalocations__')
253253

254-
instance_vars = obj.__dict__.iteritems()
254+
instance_vars = vars(obj).iteritems()
255255
return ((attr_name(name), val) for name, val in instance_vars if check(name))
256256

257257

stix/utils/walk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _iter_vars(obj):
2828
attrs = []
2929

3030
if hasattr(obj, "__dict__"):
31-
attrs.append(obj.__dict__.iteritems())
31+
attrs.append(vars(obj).iteritems())
3232

3333
if hasattr(obj, "_fields"):
3434
attrs.append(obj._fields.iteritems())

0 commit comments

Comments
 (0)