[Zope3-checkins] SVN: Zope3/trunk/src/mechanize/_mechanize.py Fix another mechanize problem identified by Stephan. test added to mechanize code and patch sent to maintainer.

Gary Poster gary at zope.com
Tue Nov 1 15:22:24 EST 2005


Log message for revision 39825:
  Fix another mechanize problem identified by Stephan.  test added to mechanize code and patch sent to maintainer.
  
  
  
  

Changed:
  U   Zope3/trunk/src/mechanize/_mechanize.py

-=-
Modified: Zope3/trunk/src/mechanize/_mechanize.py
===================================================================
--- Zope3/trunk/src/mechanize/_mechanize.py	2005-11-01 19:48:18 UTC (rev 39824)
+++ Zope3/trunk/src/mechanize/_mechanize.py	2005-11-01 20:22:24 UTC (rev 39825)
@@ -244,7 +244,8 @@
         if self._response is not None:
             self._response.close()    
         UserAgent.close(self)
-        self._history = self._forms = self._title = self._links = None
+        del self._history[:]
+        self._forms = self._title = self._links = None
         self.request = self._response = None
 
     def open(self, url, data=None):
@@ -296,6 +297,8 @@
         """Reload current document, and return response object."""
         if self.request is None:
             raise BrowserStateError("no URL has yet been .open()ed")
+        if self._response is not None:
+            self._response.close()
         return self._mech_open(self.request, update_history=False)
 
     def back(self, n=1):



More information about the Zope3-Checkins mailing list