mechanize 0.2 uses its own ControlNotFoundError exception
This commit is contained in:
parent
e5a8c2e277
commit
d5b1105b9c
3 changed files with 16 additions and 6 deletions
|
|
@ -19,7 +19,10 @@
|
|||
import mechanize
|
||||
import urllib
|
||||
import urllib2
|
||||
import ClientForm
|
||||
try:
|
||||
from mechanize import ControlNotFoundError
|
||||
except ImportError:
|
||||
from ClientForm import ControlNotFoundError
|
||||
import re
|
||||
import time
|
||||
from logging import warning, debug
|
||||
|
|
@ -174,6 +177,7 @@ class BaseBrowser(mechanize.Browser):
|
|||
if self.password:
|
||||
try:
|
||||
self.home()
|
||||
# Do not abort the build of browser when the website is down.
|
||||
except BrowserUnavailable:
|
||||
pass
|
||||
|
||||
|
|
@ -367,5 +371,5 @@ class BaseBrowser(mechanize.Browser):
|
|||
else:
|
||||
value = self.str(args[label])
|
||||
self[field] = value
|
||||
except ClientForm.ControlNotFoundError:
|
||||
except ControlNotFoundError:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue