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 import xml.sax
from wstools.XMLname import fromXMLname from wstools.XMLname import fromXMLname
import collections import collections
try: from io import StringIO, BytesIO
from io import StringIO
except ImportError:
from io import StringIO


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




||||||
x
 
000:0
Loading…
Cancel
Save