Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09b05c0

Browse files
committed
Block pickling with protocols 0 and 1 as well
1 parent fae266b commit 09b05c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

h5py/_hl/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ def __getnewargs__(self):
307307
"""
308308
raise TypeError("h5py objects cannot be pickled")
309309

310+
def __getstate__(self):
311+
# Pickle protocols 0 and 1 use this instead of __getnewargs__
312+
raise TypeError("h5py objects cannot be pickled")
310313

311314
# --- Dictionary-style interface ----------------------------------------------
312315

0 commit comments

Comments
 (0)