Skip to content

Commit 67d7481

Browse files
committed
use same import pattern for six.urllib accross the codebase
- also, re-ogranise six lib imports
1 parent 150730c commit 67d7481

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

schema_salad/jsonld_context.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
from six.moves import urllib
88

99
import ruamel.yaml as yaml
10-
import six
11-
# import urlparse
12-
from six.moves.urllib import parse
1310
try:
1411
from ruamel.yaml import CSafeLoader as SafeLoader
1512
except ImportError:
@@ -41,7 +38,7 @@ def pred(datatype, # type: Dict[str, Union[Dict, str]]
4138
namespaces # type: Dict[str, rdflib.namespace.Namespace]
4239
):
4340
# type: (...) -> Union[Dict, Text]
44-
split = parse.urlsplit(name)
41+
split = urllib.parse.urlsplit(name)
4542

4643
vee = None # type: Optional[Union[str, Text]]
4744

@@ -109,7 +106,7 @@ def process_type(t, # type: Dict[str, Any]
109106
classnode = URIRef(recordname)
110107
g.add((classnode, RDF.type, RDFS.Class))
111108

112-
split = parse.urlsplit(recordname)
109+
split = urllib.parse.urlsplit(recordname)
113110
predicate = recordname
114111
if t.get("inVocab", True):
115112
if split.scheme:
@@ -225,7 +222,7 @@ def makerdf(workflow, # type: Union[str, Text]
225222
url = v
226223
if url == "@id":
227224
idfields.append(k)
228-
doc_url, frg = parse.urldefrag(url)
225+
doc_url, frg = urllib.parse.urldefrag(url)
229226
if "/" in frg:
230227
p = frg.split("/")[0]
231228
prefixes[p] = u"%s#%s/" % (doc_url, p)

0 commit comments

Comments
 (0)