Skip to content

Commit c8ec117

Browse files
committed
graalpy: always use extern Py_CompileString function
1 parent 3fe688b commit c8ec117

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pyo3-ffi/src/cpython/pythonrun.rs

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ extern "C" {
135135
}
136136

137137
#[inline]
138+
#[cfg(not(GraalPy))]
138139
pub unsafe fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject {
139140
#[cfg(not(PyPy))]
140141
return Py_CompileStringExFlags(string, p, s, std::ptr::null_mut(), -1);

pyo3-ffi/src/pythonrun.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use crate::object::*;
22
#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
33
use libc::FILE;
4-
#[cfg(all(not(PyPy), any(Py_LIMITED_API, not(Py_3_10))))]
4+
#[cfg(all(not(PyPy), any(Py_LIMITED_API, not(Py_3_10), GraalPy)))]
55
use std::os::raw::c_char;
66
use std::os::raw::c_int;
77

88
extern "C" {
9-
#[cfg(all(Py_LIMITED_API, not(PyPy)))]
9+
#[cfg(any(all(Py_LIMITED_API, not(PyPy)), GraalPy))]
1010
pub fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject;
1111

1212
#[cfg_attr(PyPy, link_name = "PyPyErr_Print")]

0 commit comments

Comments
 (0)