Skip to content

Commit 0773e44

Browse files
committed
fix urlparse using six in tests and schema_salad core; no automated fixers
1 parent 6a11b16 commit 0773e44

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

schema_salad/jsonld_context.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import ruamel.yaml as yaml
1010
import six
11+
# import urlparse
12+
from six.moves.urllib import parse
1113
try:
1214
from ruamel.yaml import CSafeLoader as SafeLoader
1315
except ImportError:
@@ -39,7 +41,7 @@ def pred(datatype, # type: Dict[str, Union[Dict, str]]
3941
namespaces # type: Dict[str, rdflib.namespace.Namespace]
4042
):
4143
# type: (...) -> Union[Dict, Text]
42-
split = urllib.parse.urlsplit(name)
44+
split = parse.urlsplit(name)
4345

4446
vee = None # type: Optional[Union[str, Text]]
4547

@@ -107,7 +109,7 @@ def process_type(t, # type: Dict[str, Any]
107109
classnode = URIRef(recordname)
108110
g.add((classnode, RDF.type, RDFS.Class))
109111

110-
split = urllib.parse.urlsplit(recordname)
112+
split = parse.urlsplit(recordname)
111113
predicate = recordname
112114
if t.get("inVocab", True):
113115
if split.scheme:
@@ -223,7 +225,7 @@ def makerdf(workflow, # type: Union[str, Text]
223225
url = v
224226
if url == "@id":
225227
idfields.append(k)
226-
doc_url, frg = urllib.parse.urldefrag(url)
228+
doc_url, frg = parse.urldefrag(url)
227229
if "/" in frg:
228230
p = frg.split("/")[0]
229231
prefixes[p] = u"%s#%s/" % (doc_url, p)

schema_salad/makedoc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
from six.moves import range
1717
from six.moves import urllib
1818
from six import StringIO
19-
2019
from typing import cast, Any, Dict, IO, List, Optional, Set, Text, Union
21-
import six
22-
from six.moves import range
2320

2421
_logger = logging.getLogger("salad")
2522

schema_salad/ref_resolver.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
import xml.sax
3333
from typing import (cast, Any, AnyStr, Callable, Dict, List, Iterable,
3434
Optional, Set, Text, Tuple, TypeVar, Union)
35-
import six
36-
from six.moves import range
3735

3836

3937
_logger = logging.getLogger("salad")

0 commit comments

Comments
 (0)