Browse Source

remove redundant try import, use BytesIO for byte stream..

main
John-Mark Gurney 1 year ago
parent
commit
786b3ef83c
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      src/SOAPpy/Parser.py

+ 2
- 5
src/SOAPpy/Parser.py View File

@@ -9,10 +9,7 @@ import string
import xml.sax
from wstools.XMLname import fromXMLname
import collections
try:
from io import StringIO
except ImportError:
from io import StringIO
from io import StringIO, BytesIO

try: from M2Crypto import SSL
except: pass
@@ -1050,7 +1047,7 @@ class EmptyEntityResolver(xml.sax.handler.EntityResolver):
def _parseSOAP(xml_str, rules = None, ignore_ext=None,
forbid_entities=False, forbid_external=True, forbid_dtd=False):
inpsrc = xml.sax.xmlreader.InputSource()
inpsrc.setByteStream(StringIO(xml_str))
inpsrc.setByteStream(BytesIO(xml_str))
if ignore_ext is None:
ignore_ext = False



Loading…
Cancel
Save