[Python-modules-commits] [python-pyld] 256/276: Explicitly disallow empty string terms.
Wolfgang Borgert
debacle at moszumanska.debian.org
Wed Oct 8 23:48:17 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 d04091d47d4b090a04bfd445369a809a62f9a9cc
Author: Dave Longley <dlongley at digitalbazaar.com>
Date: Sun Jun 15 16:22:33 2014 -0400
Explicitly disallow empty string terms.
---
lib/pyld/jsonld.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index b4ed7a4..19922bd 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -3759,6 +3759,12 @@ class JsonLdProcessor:
'jsonld.SyntaxError', {'context': local_ctx},
code='keyword redefinition')
+ if term == '':
+ raise JsonLdError(
+ 'Invalid JSON-LD syntax; a term cannot be an empty string.',
+ 'jsonld.SyntaxError', {'context': local_ctx},
+ code='invalid term definition')
+
# remove old mapping
if term in active_ctx['mappings']:
del active_ctx['mappings'][term]
--
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