Merge pull request #2715 from messense/fix-pymodule-filename-on-pypy
Disable `PyModule::filename` on PyPy
This commit is contained in:
commit
24dabc5c08
|
@ -0,0 +1 @@
|
|||
Disable `PyModule::filename` on PyPy
|
|
@ -32,6 +32,7 @@ extern "C" {
|
|||
#[cfg(not(all(windows, PyPy)))]
|
||||
#[deprecated(note = "Python 3.2")]
|
||||
pub fn PyModule_GetFilename(arg1: *mut PyObject) -> *const c_char;
|
||||
#[cfg(not(PyPy))]
|
||||
pub fn PyModule_GetFilenameObject(arg1: *mut PyObject) -> *mut PyObject;
|
||||
// skipped non-limited _PyModule_Clear
|
||||
// skipped non-limited _PyModule_ClearDict
|
||||
|
|
|
@ -203,7 +203,7 @@ impl PyModule {
|
|||
/// Returns the filename (the `__file__` attribute) of the module.
|
||||
///
|
||||
/// May fail if the module does not have a `__file__` attribute.
|
||||
#[cfg(not(all(windows, PyPy)))]
|
||||
#[cfg(not(PyPy))]
|
||||
pub fn filename(&self) -> PyResult<&str> {
|
||||
unsafe {
|
||||
self.py()
|
||||
|
|
Loading…
Reference in New Issue