[Python-modules-commits] [python-pyld] 234/276: Skip IRI processing when base is null.
Wolfgang Borgert
debacle at moszumanska.debian.org
Wed Oct 8 23:48:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to branch master
in repository python-pyld.
commit 644f05202cb89788d0ed0e443f044a5f91e21097
Author: Dave Longley <dlongley at digitalbazaar.com>
Date: Tue Jan 7 10:58:04 2014 -0500
Skip IRI processing when base is null.
---
lib/pyld/jsonld.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index 07887dc..0b3f881 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -370,6 +370,10 @@ def prepend_base(base, iri):
:return: the absolute IRI.
"""
+ # skip IRI processing
+ if base is None:
+ return iri
+
# already an absolute iri
if _is_absolute_iri(iri):
return iri
@@ -420,6 +424,10 @@ def remove_base(base, iri):
:return: the relative IRI if relative to base, otherwise the absolute IRI.
"""
+ # skip IRI processing
+ if base is None:
+ return iri
+
base = urllib_parse.urlsplit(base)
rel = urllib_parse.urlsplit(iri)
@@ -2405,7 +2413,7 @@ class JsonLdProcessor:
'@context must be an absolute IRI or the empty '
'string.', 'jsonld.SyntaxError', {'context': ctx},
code='invalid base IRI')
- rval['@base'] = base or ''
+ rval['@base'] = base
defined['@base'] = True
# handle @vocab
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pyld.git
More information about the Python-modules-commits
mailing list