Add the nologin option to "submit"

Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
Florent 2011-11-29 16:25:13 +01:00 committed by Romain Bignon
commit 7a2b21f1b6

View file

@ -438,8 +438,9 @@ class BaseBrowser(StandardBrowser):
""" """
Submit the selected form. Submit the selected form.
""" """
nologin = kwargs.pop('nologin', False)
try: try:
self._change_location(mechanize.Browser.submit(self, *args, **kwargs)) self._change_location(mechanize.Browser.submit(self, *args, **kwargs), no_login=nologin)
except (mechanize.response_seek_wrapper, urllib2.HTTPError, urllib2.URLError, BadStatusLine), e: except (mechanize.response_seek_wrapper, urllib2.HTTPError, urllib2.URLError, BadStatusLine), e:
self.page = None self.page = None
raise self.get_exception(e)(e) raise self.get_exception(e)(e)