On Thu, 02 Aug 2012, David Watson wrote:
> Hi Raphaël,
>
> The attached patch should use the correct version of HTMLParser, it will
> use the python version for 2.6.8 and above in the 2.6 series, and 2.7.3 and
> above in the 2.7 series.
Except it does it only for the tests... what we really want is that all of
Django uses the correct HTMLParser. :-)
So the fix should be in django/utils/html_parser.py really. Not quite sure
how it should be done there. Ideally we want stdlib's HTMLParser by
default except for 2.6.Y where Y < 8 and for 2.7.X where X < 3 and
all 3.V where V < 3.
It probably requires indenting all of the class:
current_version = sys.version_info
use_workaround = (
(current_version >= (2, 6) and current_version < (2, 6, 8)) or
(current_version >= (2, 7) and current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 3))
)
if use_workaround:
HTMLParser = _html_parser
else:
class HTMLParser(_html_parser.HTMLParser):
....
Could you try something like this?
Cheers,
--
Raphaël Hertzog ◈ Debian Developer
Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]