I noticed that `ProtocolBase.__getattr__` raises a `KeyError`, although it should raise an `AttributeError`. (https://github.com/cwacek/python-jsonschema-objects/blob/master/python_jsonschema_objects/classbuilder.py#L241) This causes `hasattr()` to fail if the property does not exist: delattr(test, 'foo') assert not hasattr(test, 'foo') … File "/usr/lib/python3/dist-packages/python_jsonschema_objects/classbuilder.py", line 241, in __getattr__ raise KeyError(name) KeyError: 'foo' ` When I change this to `AttributeError` the code behaves as expected.
I noticed that
ProtocolBase.__getattr__raises aKeyError, although it should raise anAttributeError. (https://github.com/cwacek/python-jsonschema-objects/blob/master/python_jsonschema_objects/classbuilder.py#L241)This causes
hasattr()to fail if the property does not exist:`
When I change this to
AttributeErrorthe code behaves as expected.