From 8a87f09c702c091a0748ec0a2f540fe862243d89 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 2 Jan 2018 14:15:21 +0100 Subject: [PATCH] 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 --- kas/repos.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kas/repos.py b/kas/repos.py index 047c803..ba965c8 100644 --- a/kas/repos.py +++ b/kas/repos.py @@ -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,