[ZPT] HTMLParser changes introduce Python2 dependency

Fred L. Drake, Jr. fdrake@acm.org
Thu, 27 Sep 2001 01:18:11 -0400


Tres Seaver writes:
 > Would a patch using string.find() be acceptable?  E.g., replace::
 > 
 >    elif rawdata.startswith("<!--", i): # <!--
 > 
 > with::
 > 
 >    elif sfind( rawdata, "<!--", i) == -1: # <!--
 > 
 > where sfind is a locally-bound name for 'string.find'?

  This wouldn't work -- it would have to test for == i instead.  I've
checked in a somewhat different fix; we don't actually need to use a
search since we've already found *where* we're looking for; we just
need to determine what we found.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation