enable http and mechanize debugs before calling home()

This commit is contained in:
Romain Bignon 2011-07-16 11:49:14 +02:00
commit abb9b3dfc3

View file

@ -227,12 +227,6 @@ class BaseBrowser(mechanize.Browser):
self.username = username
self.password = password
self.lock = RLock()
if self.password and get_home:
try:
self.home()
# Do not abort the build of browser when the website is down.
except BrowserUnavailable:
pass
if self.DEBUG_HTTP:
# display messages from httplib
@ -242,6 +236,13 @@ class BaseBrowser(mechanize.Browser):
# Enable log messages from mechanize.Browser
self.set_debug_redirects(True)
if self.password and get_home:
try:
self.home()
# Do not abort the build of browser when the website is down.
except BrowserUnavailable:
pass
def __enter__(self):
self.lock.acquire()