From 72dee6dac7597128019054687085ac41b68bdb3e Mon Sep 17 00:00:00 2001 From: vky Date: Sat, 29 Jan 2022 23:32:39 +0100 Subject: [PATCH] changed errortype for consistency with py default behavior --- src/bootstraparse/modules/environment.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bootstraparse/modules/environment.py b/src/bootstraparse/modules/environment.py index 554dee3..a080f05 100644 --- a/src/bootstraparse/modules/environment.py +++ b/src/bootstraparse/modules/environment.py @@ -38,20 +38,20 @@ class environment(): def __getattr__(self, attribute): if attribute[0] == "_": - super().__getattr__(attribute) + super().__getattribute__(attribute) elif attribute in self._mParams: return self._mParams[attribute] elif attribute in self._sParams: return self._sParams[attribute] else: - raise KeyError(attribute) + raise AttributeError(attribute) - def __setattr__ (self, attribute, value): + def __setattr__(self, attribute, value): if attribute[0] == "_": super().__setattr__(attribute, value) elif attribute in self._mParams: self._mParams[attribute] = value elif attribute in self._sParams: self._sParams[attribute] = value - else: - raise KeyError(attribute) #could also add attribute as a new entry + else: + raise AttributeError(attribute) # Could also add attribute as a new entry