Skip to content

Commit

Permalink
tests/test_cosalib_meta.py: don't deepcopy GenericBuildMeta
Browse files Browse the repository at this point in the history
It seems like jsonschema in Python 3.12 (in Fedora 39) changed some
implementation details to now use a data structure that doesn't support
deep copying:

    TypeError: cannot pickle 'rpds.HashTrieMap' object

Instead of doing a deep copy, just create a new object from scratch with
the same inputs. The `w` variable might've been for that; it's currently
unused and is an exact copy of `m`.
  • Loading branch information
jlebon committed Nov 14, 2023
1 parent 959eea7 commit 2e24c46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_cosalib_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ def get_aws(x, key="path"):
m = meta.GenericBuildMeta(_create_test_files(tmpdir, meta_data=td),
'1.2.3')

# create working copies
w = meta.GenericBuildMeta(_create_test_files(tmpdir, meta_data=td),
'1.2.3')
# create working copies
if x is None:
x = copy.deepcopy(m)
x = w
else:
y = copy.deepcopy(m)
y = w

# add the stamp
m.write()
Expand Down

0 comments on commit 2e24c46

Please sign in to comment.