Raise AttributeError.
authorTim 'mithro' Ansell <mithro@mithis.com>
Fri, 23 Dec 2016 10:14:18 +0000 (11:14 +0100)
committerTim 'mithro' Ansell <mithro@mithis.com>
Fri, 23 Dec 2016 10:14:18 +0000 (11:14 +0100)
Makes hasattr work correctly.

litex/soc/tools/remote/csr_builder.py

index 07edc61e2a83e589d8eb7d8a6dc9b14d5974f426..1bbb54a7ccdd06dff41bf879bb96d4cd55528865 100644 (file)
@@ -14,7 +14,7 @@ class CSRElements:
             return self.__dict__[attr]
         except KeyError:
             pass
-        raise KeyError("No such element " + attr)
+        raise AttributeError("No such element " + attr)
 
 
 class CSRRegister: