Skip to content

Commit

Permalink
Update serialization.jl (#494)
Browse files Browse the repository at this point in the history
making it possible to use another package instead of `pickle` for serialization (e.g. `dill`)
  • Loading branch information
schlichtanders committed May 12, 2024
1 parent 662e7ae commit f898a2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Compat/serialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function serialize_py(s, x::Py)
if pyisnull(x)
serialize(s, nothing)
else
b = pyimport("pickle").dumps(x)
b = pyimport(get(ENV, "JULIA_PYTHONCALL_PICKLE", "pickle")).dumps(x)
serialize(s, pybytes_asvector(b))
end
end
Expand All @@ -16,7 +16,7 @@ function deserialize_py(s)
if v === nothing
pynew()
else
pyimport("pickle").loads(pybytes(v))
pyimport(get(ENV, "JULIA_PYTHONCALL_PICKLE", "pickle")).loads(pybytes(v))
end
end

Expand Down

0 comments on commit f898a2c

Please sign in to comment.