Skip to content

Commit 1444ee3

Browse files
committed
[GR-45311] Delegate to internal bytearray for BytesIO
PullRequest: graalpython/2711
2 parents 6b47c91 + b2994e3 commit 1444ee3

File tree

1 file changed

+2
-14
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/io

1 file changed

+2
-14
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/io/PBytesIOBuffer.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -44,10 +44,9 @@
4444
import com.oracle.graal.python.builtins.objects.bytes.PByteArray;
4545
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
4646
import com.oracle.truffle.api.library.ExportLibrary;
47-
import com.oracle.truffle.api.library.ExportMessage;
4847
import com.oracle.truffle.api.object.Shape;
4948

50-
@ExportLibrary(value = PythonBufferAcquireLibrary.class)
49+
@ExportLibrary(value = PythonBufferAcquireLibrary.class, delegateTo = "delegate")
5150
public final class PBytesIOBuffer extends PythonBuiltinObject {
5251

5352
private final PBytesIO source;
@@ -62,15 +61,4 @@ public PBytesIOBuffer(Object cls, Shape instanceShape, PBytesIO source) {
6261
public PBytesIO getSource() {
6362
return source;
6463
}
65-
66-
@ExportMessage
67-
@SuppressWarnings("static-method")
68-
boolean hasBuffer() {
69-
return true;
70-
}
71-
72-
@ExportMessage
73-
Object acquire(@SuppressWarnings("unused") int flags) {
74-
return delegate.getSequenceStorage();
75-
}
7664
}

0 commit comments

Comments
 (0)