SF patch# 1759922 by Alexandre Vassalotti.
Fix one of the two failing tests for minidom.
This commit is contained in:
parent
624ab7c28a
commit
3992db81b6
|
@ -2,11 +2,6 @@ import xml.sax
|
||||||
import xml.sax.handler
|
import xml.sax.handler
|
||||||
import types
|
import types
|
||||||
|
|
||||||
try:
|
|
||||||
_StringTypes = [types.StringType, types.UnicodeType]
|
|
||||||
except AttributeError:
|
|
||||||
_StringTypes = [types.StringType]
|
|
||||||
|
|
||||||
START_ELEMENT = "START_ELEMENT"
|
START_ELEMENT = "START_ELEMENT"
|
||||||
END_ELEMENT = "END_ELEMENT"
|
END_ELEMENT = "END_ELEMENT"
|
||||||
COMMENT = "COMMENT"
|
COMMENT = "COMMENT"
|
||||||
|
@ -330,7 +325,7 @@ default_bufsize = (2 ** 14) - 20
|
||||||
def parse(stream_or_string, parser=None, bufsize=None):
|
def parse(stream_or_string, parser=None, bufsize=None):
|
||||||
if bufsize is None:
|
if bufsize is None:
|
||||||
bufsize = default_bufsize
|
bufsize = default_bufsize
|
||||||
if type(stream_or_string) in _StringTypes:
|
if isinstance(stream_or_string, basestring):
|
||||||
stream = open(stream_or_string)
|
stream = open(stream_or_string)
|
||||||
else:
|
else:
|
||||||
stream = stream_or_string
|
stream = stream_or_string
|
||||||
|
|
Loading…
Reference in New Issue