From d472fd6eec9a8a9a9885b37c8469eb1cdc0a5978 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Thu, 13 Mar 2014 21:40:53 +0100 Subject: [PATCH] fix crash --- weboob/tools/browser2/page.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/weboob/tools/browser2/page.py b/weboob/tools/browser2/page.py index 5e205caf..0f96e184 100644 --- a/weboob/tools/browser2/page.py +++ b/weboob/tools/browser2/page.py @@ -114,6 +114,14 @@ class URL(object): def id2url(self, func): def inner(browser, _id, *args, **kwargs): + # id2url is called with the global instance of URL, so there is no + # browser set. As except for this kind of thing, the class instance + # won't be called, we don't care about changing the 'browser' + # attriibute to let match() looks for the BASEURL attribute. + # A solution could be to set browser to the class instead of the + # instance, but it is possible to a browser to have a variable + # BASEURL. + self.browser = browser if re.match('^https?://.*', _id): _id = self.match(_id) if _id is None: