fix import of ControlNotFoundError to be compliant with all versions of mechanize
This commit is contained in:
parent
b5815f0185
commit
ab79d11484
1 changed files with 2 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ from weboob.capabilities.bank import Account, Transaction
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
from weboob.tools.parsers import get_parser
|
from weboob.tools.parsers import get_parser
|
||||||
from weboob.tools.parsers.iparser import IParser
|
from weboob.tools.parsers.iparser import IParser
|
||||||
from mechanize import ControlNotFoundError
|
from weboob.tools.mech import ClientForm
|
||||||
from urllib import unquote
|
from urllib import unquote
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from .parsers import StatementParser, clean_amount, clean_label
|
from .parsers import StatementParser, clean_amount, clean_label
|
||||||
|
|
@ -40,7 +40,7 @@ def form_with_control(control_name):
|
||||||
def predicate(form):
|
def predicate(form):
|
||||||
try:
|
try:
|
||||||
form.find_control(name=control_name)
|
form.find_control(name=control_name)
|
||||||
except ControlNotFoundError:
|
except ClientForm.ControlNotFoundError:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue