diff --git a/pymarshaler/__init__.py b/pymarshaler/__init__.py index d441390..0d2cf7e 100644 --- a/pymarshaler/__init__.py +++ b/pymarshaler/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.2.2' +__version__ = '0.2.3' __all__ = ['Marshal', 'utils', 'arg_delegates', 'errors'] from pymarshaler.marshal import Marshal diff --git a/pymarshaler/marshal.py b/pymarshaler/marshal.py index 2acfe02..eb24fb5 100644 --- a/pymarshaler/marshal.py +++ b/pymarshaler/marshal.py @@ -22,9 +22,9 @@ def register(self, cls, delegate: ArgBuilderDelegate): def get_for(self, cls): try: - for val in self.registered_delegates: - if cls == val or issubclass(cls, val): - return self.registered_delegates[val] + for delegate_cls, delegate in self.registered_delegates.items(): + if cls == delegate_cls or issubclass(cls, delegate_cls): + return delegate return None except TypeError: return None diff --git a/setup.py b/setup.py index 450b70a..299036c 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="pymarshaler", - version="0.2.2", + version="0.2.3", author="Hernan Romer", author_email="nanug33@gmail.com", description="Package to marshal and unmarshal python objects", diff --git a/tests/test_marshaling.py b/tests/test_marshaling.py index 5d08201..794123e 100644 --- a/tests/test_marshaling.py +++ b/tests/test_marshaling.py @@ -1,7 +1,6 @@ import json import unittest -from pymarshaler import marshal from pymarshaler.errors import MissingFieldsError, UnknownFieldError from pymarshaler.marshal import Marshal from tests.test_classes import *