Open GoogleCodeExporter opened 8 years ago
Original comment by useboxnet
on 8 May 2014 at 5:59
I'm not sure about this patch, HTMLParser.__Init__ doesn't have parameters in
python 2.
Original comment by useboxnet
on 16 Jul 2014 at 5:18
I started looking into using `inspect.getargspec`, but on py3k we'd need to use
`inspect.getfullargspec` which doesn't exist on python2...
It should work just to triage based on `sys.version[0] == '3'`. WDYT?
Original comment by larson.e...@gmail.com
on 16 Jul 2014 at 5:26
Well, we have this module already:
https://code.google.com/p/pyglet/source/browse/pyglet/compat.py
Original comment by useboxnet
on 16 Jul 2014 at 6:10
One solution would then be to wrap it like this for Python3:
HTMLParser_init = partial(HTMLParser.HTMLParser.__init__, convert_charrefs=True)
and for Python2:
HTMLParser_init = HTMLParser.HTMLParser.__init__
And then have `pyglet.text.formats` import it from `compat.py`.
Original comment by larson.e...@gmail.com
on 16 Jul 2014 at 6:17
Sounds OK. I don't have a strong opinion besides using the compat module :)
Thanks!
Original comment by useboxnet
on 16 Jul 2014 at 6:29
Original issue reported on code.google.com by
larson.e...@gmail.com
on 7 May 2014 at 6:23