Skip to content

Commit

Permalink
graalpy: always use extern Py_CompileString function
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Sep 15, 2023
1 parent 3fe688b commit c8ec117
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyo3-ffi/src/cpython/pythonrun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ extern "C" {
}

#[inline]
#[cfg(not(GraalPy))]
pub unsafe fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject {
#[cfg(not(PyPy))]
return Py_CompileStringExFlags(string, p, s, std::ptr::null_mut(), -1);
Expand Down
4 changes: 2 additions & 2 deletions pyo3-ffi/src/pythonrun.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::object::*;
#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
use libc::FILE;
#[cfg(all(not(PyPy), any(Py_LIMITED_API, not(Py_3_10))))]
#[cfg(all(not(PyPy), any(Py_LIMITED_API, not(Py_3_10), GraalPy)))]
use std::os::raw::c_char;
use std::os::raw::c_int;

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

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

0 comments on commit c8ec117

Please sign in to comment.