Skip to content

Commit

Permalink
Merge pull request #158 from jfennick/no_deepcopy_cache
Browse files Browse the repository at this point in the history
Do not deepcopy the cache!
  • Loading branch information
trungdong authored May 29, 2024
2 parents 95fd523 + 050ee3b commit ec9d8c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/prov/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
PROV-JSON: https://openprovenance.org/prov-json/
"""
from collections import defaultdict
from copy import deepcopy
import datetime
import io
import itertools
Expand Down Expand Up @@ -1177,8 +1176,8 @@ def valid_qualified_name(self, qname):
# reuse the existing namespace
new_qname = existing_ns[local_part]
else:
# Do not reuse the namespace object
ns = self.add_namespace(deepcopy(namespace))
# Do not reuse the namespace object, making an identical copy
ns = self.add_namespace(Namespace(namespace.prefix, namespace.uri))
# minting the same Qualified Name from the namespace's copy
new_qname = ns[qname.localpart]
# returning the new qname
Expand Down

0 comments on commit ec9d8c8

Please sign in to comment.