Skip to content

Commit f898a2c

Browse files
Update serialization.jl (#494)
making it possible to use another package instead of `pickle` for serialization (e.g. `dill`)
1 parent 662e7ae commit f898a2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Compat/serialization.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function serialize_py(s, x::Py)
66
if pyisnull(x)
77
serialize(s, nothing)
88
else
9-
b = pyimport("pickle").dumps(x)
9+
b = pyimport(get(ENV, "JULIA_PYTHONCALL_PICKLE", "pickle")).dumps(x)
1010
serialize(s, pybytes_asvector(b))
1111
end
1212
end
@@ -16,7 +16,7 @@ function deserialize_py(s)
1616
if v === nothing
1717
pynew()
1818
else
19-
pyimport("pickle").loads(pybytes(v))
19+
pyimport(get(ENV, "JULIA_PYTHONCALL_PICKLE", "pickle")).loads(pybytes(v))
2020
end
2121
end
2222

0 commit comments

Comments
 (0)