diff options
| author | Iwan Aucamp <aucampia@gmail.com> | 2023-03-24 19:17:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-24 19:17:16 +0100 |
| commit | 832e6931af6be32f71993088d70ae93a5cb9cb05 (patch) | |
| tree | 8994a9d359e0bcf89d7c454cfe808a254d99d9d4 /rdflib | |
| parent | 1ab4fc0533d8042e06d7201d7d80d2f41cda83d7 (diff) | |
| download | rdflib-832e6931af6be32f71993088d70ae93a5cb9cb05.tar.gz | |
fix: JSON-LD context construction from a `dict` (#2306)
A variable was only being initialized for string-valued inputs, but if a `dict`
input was passed the variable would still be accessed, resulting in a
`UnboundLocalError`.
This change initializes the variable always, instead of only when string-valued
input is used to construct a JSON-LD context.
- Closes <https://github.com/RDFLib/rdflib/issues/2303>.
Diffstat (limited to 'rdflib')
| -rw-r--r-- | rdflib/plugins/shared/jsonld/context.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rdflib/plugins/shared/jsonld/context.py b/rdflib/plugins/shared/jsonld/context.py index 23ab6db2..d0224d4a 100644 --- a/rdflib/plugins/shared/jsonld/context.py +++ b/rdflib/plugins/shared/jsonld/context.py @@ -421,13 +421,13 @@ class Context(object): ): for source in inputs: source_url = in_source_url + new_base = base if isinstance(source, str): source_url = source source_doc_base = base or self.doc_base new_ctx = self._fetch_context( source, source_doc_base, referenced_contexts ) - new_base = base if new_ctx is None: continue else: |
