repos: Raise exception if attribute is unknown in __getattr__

pylint reports

R: 52, 4: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)

According the Python documentation we should raise AttributeError
if the key is unknown.

Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
This commit is contained in:
Daniel Wagner 2018-01-02 14:15:21 +01:00
parent 90315d47bf
commit 8a87f09c70

View File

@ -62,6 +62,9 @@ class Repo:
.replace(':', '.')
.replace('/', '.')
.replace('*', '.'))
else:
# Default behaviour
raise AttributeError
def __str__(self):
return '%s:%s %s %s' % (self.url, self.refspec,