[wwwsearch-commits] r19208 - wwwsearch/mechanize/trunk/mechanize

jjlee at codespeak.net jjlee at codespeak.net
Sun Oct 30 21:28:05 CET 2005


Author: jjlee
Date: Sun Oct 30 21:28:04 2005
New Revision: 19208

Modified:
   wwwsearch/mechanize/trunk/mechanize/_mechanize.py
Log:
Let AttributeError exceptions from ClientForm propagate (duh)

Modified: wwwsearch/mechanize/trunk/mechanize/_mechanize.py
==============================================================================
--- wwwsearch/mechanize/trunk/mechanize/_mechanize.py	(original)
+++ wwwsearch/mechanize/trunk/mechanize/_mechanize.py	Sun Oct 30 21:28:04 2005
@@ -556,15 +556,11 @@
     def __getattr__(self, name):
         # pass through ClientForm / DOMForm methods and attributes
         form = self.__dict__.get("form")
-        if form is not None:
-            try:
-                return getattr(form, name)
-            except AttributeError, exc:
-                msg = str(exc)
-        else:
-            msg = ("%s instance has no attribute %s (perhaps you forgot to "
-                   ".select_form()?)" % (self.__class__, name))
-        raise AttributeError(msg)
+        if form is None:
+            raise AttributeError(
+                "%s instance has no attribute %s (perhaps you forgot to "
+                ".select_form()?)" % (self.__class__, name))
+        return getattr(form, name)
 
 #---------------------------------------------------
 # Private methods.


More information about the wwwsearch-commits mailing list