Skip to content

Commit 95a80d1

Browse files
committed
allow loading marshalled data from memoryview
1 parent 1459b0d commit 95a80d1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/MarshalModuleBuiltins.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ Object doit(PByteArray bytes,
156156
@Cached("create()") BytesNodes.ToBytesNode toBytesNode) {
157157
return marshaller.execute(toBytesNode.execute(bytes), CURRENT_VERSION);
158158
}
159+
160+
@SuppressWarnings("unused")
161+
@Specialization
162+
Object doit(PMemoryView bytes,
163+
@Cached("create()") BytesNodes.ToBytesNode toBytesNode) {
164+
return marshaller.execute(toBytesNode.execute(bytes), CURRENT_VERSION);
165+
}
159166
}
160167

161168
private static final char TYPE_NULL = '0';

0 commit comments

Comments
 (0)