Skip to content

Commit c3fc929

Browse files
gkelloggdavidlehn
authored andcommitted
Fix inverse context cache indexing to use the uuid field, instead of the object id of the active context.
Fixes #119.
1 parent 6391c22 commit c3fc929

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# pyld ChangeLog
22

3+
### Changed
4+
* Fix inverse context cache indexing to use the uuid field
5+
36
## 2.0.1 - 2020-04-15
47

58
### Changed

lib/pyld/jsonld.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5540,7 +5540,7 @@ def _get_inverse_context(self, active_ctx):
55405540
:return: the inverse context.
55415541
"""
55425542
# inverse context already generated
5543-
inverse = _inverse_context_cache.get(id(active_ctx))
5543+
inverse = _inverse_context_cache.get(active_ctx['_uuid'])
55445544
if inverse:
55455545
return inverse
55465546

@@ -5613,7 +5613,7 @@ def _get_inverse_context(self, active_ctx):
56135613
entry['@type'].setdefault('@none', term)
56145614
entry['@language'].setdefault('@none', term)
56155615

5616-
_inverse_context_cache[id(active_ctx)] = inverse
5616+
_inverse_context_cache[active_ctx['_uuid']] = inverse
56175617
return inverse
56185618

56195619
def _clone_active_context(self, active_ctx):

0 commit comments

Comments
 (0)