htmldata and python 2.2

Paul Clinch pclinch at internet-glue.co.uk
Tue Oct 19 08:46:48 EDT 2004


"Tim Arnold" <tiarno at sas.com> wrote in message news:<ckmjth$i26$1 at license1.unx.sas.com>...
> the htmldata module looks just like what I need, but it's for Python 2.3,
> and  I'm stuck at Python 2.2 (using HP ux10.10)
> 
> Is anyone using this module with Python 2.2?
> I see that it's using the new 2.3 additions to shlex, and I don't know if  I
> can (or how-to) use some workaround.
> 
> any suggestions or pointers appreciated.
> 
> thanks in advance,
> --Tim Arnold

In fact it doesn't appear to use shlex at all. Converting the
enumerate function to zip( range( len(l) ), l ) all the unit tests are
passed with python 2.2.3. A simple diff. follows:-

138c138
<   for (j, (a, b)) in zip( range( len(_IGNORE_TAGS) ), _IGNORE_TAGS
):
---
>   for (j, (a, b)) in enumerate(_IGNORE_TAGS):
396c396
<   for (i, text) in zip( range( len(L) ), L ):
---
>   for (i, text) in enumerate(L):
829c829
<     for (i, item) in zip( range( len(L) ), L ):
---
>     for (i, item) in enumerate(L):


Regards, Paul Clinch



More information about the Python-list mailing list