Browse Source

handling StringIO import for python 2 and 3

main
Julien Iguchi-Cartigny 10 years ago
parent
commit
f354b1509f
2 changed files with 9 additions and 2 deletions
  1. +5
    -1
      wstools/WSDLTools.py
  2. +4
    -1
      wstools/c14n.py

+ 5
- 1
wstools/WSDLTools.py View File

@@ -10,7 +10,11 @@
ident = "$Id$"

import weakref
from cStringIO import StringIO
try:
from io import StringIO
except ImportError:
from cStringIO import StringIO

from Namespaces import OASIS, XMLNS, WSA, WSA_LIST, WSAW_LIST, WSRF_V1_2, WSRF
from Utility import Collection, CollectionNS, DOM, ElementProxy, basejoin
from XMLSchema import XMLSchema, SchemaReader, WSDLToolsAdapter


+ 4
- 1
wstools/c14n.py View File

@@ -56,7 +56,10 @@ except:
BASE = "http://www.w3.org/2000/xmlns/"
XML = "http://www.w3.org/XML/1998/namespace"

import io
try:
from io import StringIO
except ImportError:
from cStringIO import StringIO

_attrs = lambda E: (E.attributes and list(E.attributes.values())) or []
_children = lambda E: E.childNodes or []


Loading…
Cancel
Save