Skip to content

Commit cb69fc7

Browse files
committed
Add patch for cloudpickle
1 parent ac40c40 commit cb69fc7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff --git a/cloudpickle/cloudpickle.py b/cloudpickle/cloudpickle.py
2+
index 317be69..4e409e4 100644
3+
--- a/cloudpickle/cloudpickle.py
4+
+++ b/cloudpickle/cloudpickle.py
5+
@@ -512,6 +512,8 @@ def _walk_global_ops(code):
6+
"""
7+
Yield referenced name for all global-referencing instructions in *code*.
8+
"""
9+
+ # GraalPy change: we don't support dis
10+
+ yield from code.co_names
11+
for instr in dis.get_instructions(code):
12+
op = instr.opcode
13+
if op in GLOBAL_OPS:
14+
diff --git a/cloudpickle/cloudpickle_fast.py b/cloudpickle/cloudpickle_fast.py
15+
index 63aaffa..65ff18c 100644
16+
--- a/cloudpickle/cloudpickle_fast.py
17+
+++ b/cloudpickle/cloudpickle_fast.py
18+
@@ -21,6 +21,7 @@ import struct
19+
import types
20+
import weakref
21+
import typing
22+
+import platform
23+
24+
from enum import Enum
25+
from collections import ChainMap, OrderedDict
26+
@@ -663,7 +664,7 @@ class CloudPickler(Pickler):
27+
self.globals_ref = {}
28+
assert hasattr(self, 'proto')
29+
30+
- if pickle.HIGHEST_PROTOCOL >= 5 and not PYPY:
31+
+ if pickle.HIGHEST_PROTOCOL >= 5 and platform.python_implementation() == 'CPython':
32+
# Pickler is the C implementation of the CPython pickler and therefore
33+
# we rely on reduce_override method to customize the pickler behavior.
34+

0 commit comments

Comments
 (0)