Skip to content

Commit 48e9e20

Browse files
committed
object.py fix getstate builtin
1 parent 5d0f953 commit 48e9e20

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graalpython/lib-graalpython/object.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ def reduce_newobj(obj):
9090
try:
9191
getstate = obj.__getstate__
9292
except AttributeError:
93+
if getattr(type(obj), '__itemsize__', None):
94+
raise TypeError("cannot pickle '{}' object".format(type(obj).__name__))
95+
9396
state = getattr(obj, "__dict__", None)
9497
names = slotnames(cls) # not checking for list
9598
if names is not None:

0 commit comments

Comments
 (0)