[Python-modules-commits] [python-pyld] 176/276: Fix typos.

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Oct 8 23:48:08 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 b26d850e3df978773d82fa14210fc63e3f743924
Author: Dave Longley <dlongley at digitalbazaar.com>
Date:   Mon Sep 9 23:28:35 2013 -0400

    Fix typos.
---
 lib/pyld/jsonld.py | 10 +++++-----
 tests/runtests.py  |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index 4617e90..34c8b64 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -1924,7 +1924,7 @@ class JsonLdProcessor:
             rval['@type'] = [rval['@type']]
         # handle @set and @list
         elif '@set' in rval or '@list' in rval:
-            if count > 1 and (count != 2 and '@index' in rval):
+            if count > 1 and not (count == 2 and '@index' in rval):
                 raise JsonLdError(
                     'Invalid JSON-LD syntax; if an element has the '
                     'property "@set" or "@list", then it can have at most '
@@ -3732,7 +3732,7 @@ class JsonLdProcessor:
             if type_ != '@id' and type_ != '@vocab':
                 # expand @type to full IRI
                 type_ = self._expand_iri(
-                    active_ctx, type_, vocab=True, base=True,
+                    active_ctx, type_, vocab=True,
                     local_ctx=local_ctx, defined=defined)
                 if not _is_absolute_iri(type_):
                     raise JsonLdError(
@@ -3955,8 +3955,8 @@ class JsonLdProcessor:
                     'Cyclical @context URLs detected.',
                     'jsonld.ContextUrlError', {'url': url},
                     code='recursive context inclusion')
-            _cycles = copy.deepcopy(cycles)
-            _cycles[url] = True
+            cycles_ = copy.deepcopy(cycles)
+            cycles_[url] = True
 
             # retrieve URL
             remote_doc = load_document(url)
@@ -3992,7 +3992,7 @@ class JsonLdProcessor:
                 ctx['@context'].append(remote_doc['contextUrl'])
 
             # recurse
-            self._retrieve_context_urls(ctx, cycles, load_document, url)
+            self._retrieve_context_urls(ctx, cycles_, load_document, url)
             urls[url] = ctx['@context']
 
         # replace all URLs in the input
diff --git a/tests/runtests.py b/tests/runtests.py
index 6ff5a79..d9524c5 100644
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -203,7 +203,7 @@ def get_jsonld_error_code(err):
             return err.code
         elif err.cause:
             return get_jsonld_error_code(err.cause)
-    return err.msg
+    return err.message
 
 
 def read_json(filename):
@@ -249,7 +249,7 @@ def create_test_options(opts=None):
         options.update(opts or {})
         if 'expandContext' in options:
             filename = os.path.join(test.dirname, options['expandContext'])
-            options['expandContext'] = readJson(filename)
+            options['expandContext'] = read_json(filename)
         return options
     return create
 

-- 
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