Skip to content

Commit 6636383

Browse files
committed
Fix linter issues
1 parent 4ec675f commit 6636383

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/pyld/jsonld.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4346,7 +4346,7 @@ def _cleanup_preserve(self, input_, options):
43464346
idx = options['link'][id_].index(input_)
43474347
# already visited
43484348
return options['link'][id_][idx]
4349-
except:
4349+
except ValueError:
43504350
# prevent circular visitation
43514351
options['link'][id_].append(input_)
43524352
else:
@@ -4386,7 +4386,7 @@ def _cleanup_null(self, input_, options):
43864386
idx = options['link'][id_].index(input_)
43874387
# already visited
43884388
return options['link'][id_][idx]
4389-
except:
4389+
except ValueError:
43904390
# prevent circular visitation
43914391
options['link'][id_].append(input_)
43924392
else:
@@ -5019,7 +5019,8 @@ def _create_term_definition(self, active_ctx, local_ctx, term, defined, options,
50195019
mapping['@id'] = active_ctx['@vocab'] + term
50205020

50215021
if (value.get('@protected') or
5022-
(defined.get('@protected') and value.get('@protected') != False)):
5022+
(defined.get('@protected') and value.get('@protected', True))):
5023+
warnings.warn(value.get('@protected'))
50235024
mapping['protected'] = True
50245025

50255026
if '@type' in value:

0 commit comments

Comments
 (0)