Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
better (and correct) way to return None
Browse files Browse the repository at this point in the history
  • Loading branch information
didrocks committed Jun 4, 2013
1 parent 88c61f0 commit 762e7c3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ottolib/configgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ def __init__(self, config_file):
if os.path.isfile(self._config_file):
self.__load_parameters_from_file(self._config_file)

def __getattribute__(self, name):
def __getattr__(self, name):
"""Return None if the attr doesn't exist"""
try:
return object.__getattribute__(self, name)
except AttributeError:
return None
return None

def __setattr__(self, name, value):
"""Ask to save if the attribute make sense to be saved."""
Expand Down

0 comments on commit 762e7c3

Please sign in to comment.