Skip to content

Commit 7f8f8bd

Browse files
committed
Change expected exception in mmap test
1 parent c5131fd commit 7f8f8bd

File tree

1 file changed

+4
-5
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests/cpyext

1 file changed

+4
-5
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_mmap.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -36,7 +36,7 @@
3636
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3737
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3838
# SOFTWARE.
39-
39+
import io
4040
import mmap
4141
import sys
4242
import tempfile
@@ -55,12 +55,11 @@ def create_and_map_file():
5555
def _reference_buffer(args):
5656
if sys.implementation.name == 'graalpy' and __graalpython__.posix_module_backend() == 'java':
5757
# Cannot get mmap pointer under emulated backend
58-
raise OSError
58+
raise io.UnsupportedOperation
5959
return b"hello, world"
6060

6161

6262
class TestPyMmap(CPyExtTestCase):
63-
6463
test_buffer = CPyExtFunction(
6564
_reference_buffer,
6665
lambda: (
@@ -79,7 +78,7 @@ class TestPyMmap(CPyExtTestCase):
7978
for (i=0; i < buf.len; i++) {
8079
data[i] = ((char *) buf.buf)[i];
8180
}
82-
return PyBytes_FromStringAndSize(data, len);
81+
return PyBytes_FromStringAndSize(data, len);
8382
}
8483
""",
8584
resultspec="O",

0 commit comments

Comments
 (0)