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
|
|
@ -16,7 +16,10 @@
|
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
import ClientForm
|
||||
try:
|
||||
from mechanize import ControlNotFoundError
|
||||
except ImportError:
|
||||
from ClientForm import ControlNotFoundError
|
||||
|
||||
from .base import CragrBasePage
|
||||
|
||||
|
|
@ -33,7 +36,7 @@ class LoginPage(CragrBasePage):
|
|||
try:
|
||||
self.browser['numero'] = login
|
||||
self.browser['code'] = password
|
||||
except ClientForm.ControlNotFoundError:
|
||||
except ControlNotFoundError:
|
||||
try:
|
||||
self.browser['userLogin'] = login
|
||||
self.browser['userPassword'] = password
|
||||
|
|
|
|||
|
|
@ -15,8 +15,11 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
try:
|
||||
from mechanize import ControlNotFoundError
|
||||
except ImportError:
|
||||
from ClientForm import ControlNotFoundError
|
||||
|
||||
import ClientForm
|
||||
from mechanize import FormNotFoundError
|
||||
from weboob.tools.browser import BasePage
|
||||
|
||||
|
|
@ -30,5 +33,5 @@ class PornPage(BasePage):
|
|||
self.browser.select_form(nr=0)
|
||||
self.browser.submit(name='user_choice')
|
||||
return False
|
||||
except (ClientForm.ControlNotFoundError,FormNotFoundError):
|
||||
except (ControlNotFoundError,FormNotFoundError):
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue