changeset 1432:6219e911d261

if user.__getattr__ internally triggers a KeyError, transform it to AttributeError
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 16 Jul 2012 16:13:12 +0200
parents 33466da28757
children 9a165b096ff9
files MoinMoin/user.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/user.py	Sun Jul 15 23:51:17 2012 +0200
+++ b/MoinMoin/user.py	Mon Jul 16 16:13:12 2012 +0200
@@ -322,7 +322,10 @@
                     MAILTO_AUTHOR, SHOW_COMMENTS, RESULTS_PER_PAGE, EDIT_ON_DOUBLECLICK,
                     THEME_NAME, LOCALE, TIMEZONE, SUBSCRIBED_ITEMS, QUICKLINKS,
                    ]:
-            return self.profile[name]
+            try:
+                return self.profile[name]
+            except KeyError:
+                raise AttributeError(name)
         else:
             raise AttributeError(name)