From ad22e8153edd139995a391d97d0db3e5f77c026e Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 24 May 2013 17:15:49 +0200 Subject: [PATCH] ignore extra-lines in accounts list --- modules/paypal/pages.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/paypal/pages.py b/modules/paypal/pages.py index 45827e5c..e59986a5 100644 --- a/modules/paypal/pages.py +++ b/modules/paypal/pages.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from decimal import Decimal +from decimal import Decimal, InvalidOperation import re import datetime @@ -107,7 +107,11 @@ class AccountPage(BasePage): balance = row.xpath('.//td')[-1].text_content().strip() account = Account() account.type = Account.TYPE_CHECKING - account.balance = clean_amount(balance) + # XXX it ignores 5+ devises, so it's bad, but it prevents a crash, cf #1216 + try: + account.balance = clean_amount(balance) + except InvalidOperation: + continue account.currency = Account.get_currency(balance) account.id = unicode(account.currency) account.label = u'%s %s' % (self.browser.username, balance.split()[-1])