Stylistic nitpick: python can do:
    if 200 <= e.code <= 299:
;)

Florent


Benji York wrote:
Modified: Zope3/trunk/src/zope/testbrowser/browser.py
===================================================================
--- Zope3/trunk/src/zope/testbrowser/browser.py 2006-03-15 21:35:12 UTC (rev 
66047)
+++ Zope3/trunk/src/zope/testbrowser/browser.py 2006-03-15 21:43:56 UTC (rev 
66048)
@@ -207,7 +207,15 @@
     def open(self, url, data=None):
         """See zope.testbrowser.interfaces.IBrowser"""
         self._start_timer()
-        self.mech_browser.open(url, data)
+        try:
+            self.mech_browser.open(url, data)
+        except urllib2.HTTPError, e:
+            if e.code >= 200 and e.code <= 299:
+                # 200s aren't really errors
+                pass
+            else:
+                raise
+
         self._stop_timer()
         self._changed()


--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to