Skip to content

Commit ed245c8

Browse files
Patrick St-Louisdavidlehn
authored andcommitted
change 2 if statements
Signed-off-by: Patrick St-Louis <patrick.st-louis@idlab.org>
1 parent 74acfc6 commit ed245c8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/pyld/context_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def resolve(self, active_ctx, context, base, cycles=None):
6363
all_resolved.extend(resolved)
6464
else:
6565
all_resolved.append(resolved)
66-
elif not ctx:
66+
elif ctx is None:
6767
all_resolved.append(ResolvedContext(False))
6868
elif not isinstance(ctx, dict) and not isinstance(ctx, frozendict):
6969
raise jsonld.JsonLdError(

lib/pyld/jsonld.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,7 @@ def _expand(
23202320
for type_ in sorted(types):
23212321
ctx = JsonLdProcessor.get_context_value(
23222322
type_scoped_ctx, type_, '@context')
2323-
if ctx is not None:
2323+
if ctx:
23242324
active_ctx = self._process_context(
23252325
active_ctx, ctx, options, propagate=False)
23262326

@@ -3070,7 +3070,7 @@ def _process_context(self, active_ctx, local_ctx, options,
30703070
active_ctx['_uuid'] = str(uuid.uuid1())
30713071

30723072
# reset to initial context
3073-
if not ctx:
3073+
if ctx is None:
30743074
if (not override_protected and
30753075
any(v.get('protected') for v in rval['mappings'].values())):
30763076
raise JsonLdError(

0 commit comments

Comments
 (0)