@@ -191,6 +191,7 @@ impl InterpreterConfig {
191191 PythonImplementation :: CPython => { }
192192 PythonImplementation :: PyPy => out. push ( "cargo:rustc-cfg=PyPy" . to_owned ( ) ) ,
193193 PythonImplementation :: GraalPy => out. push ( "cargo:rustc-cfg=GraalPy" . to_owned ( ) ) ,
194+ PythonImplementation :: RustPython => out. push ( "cargo:rustc-cfg=RustPython" . to_owned ( ) ) ,
194195 }
195196
196197 // If Py_GIL_DISABLED is set, do not build with limited API support
@@ -780,6 +781,7 @@ pub enum PythonImplementation {
780781 CPython ,
781782 PyPy ,
782783 GraalPy ,
784+ RustPython ,
783785}
784786
785787impl PythonImplementation {
@@ -813,6 +815,7 @@ impl Display for PythonImplementation {
813815 PythonImplementation :: CPython => write ! ( f, "CPython" ) ,
814816 PythonImplementation :: PyPy => write ! ( f, "PyPy" ) ,
815817 PythonImplementation :: GraalPy => write ! ( f, "GraalVM" ) ,
818+ PythonImplementation :: RustPython => write ! ( f, "RustPython" ) ,
816819 }
817820 }
818821}
@@ -824,6 +827,7 @@ impl FromStr for PythonImplementation {
824827 "CPython" => Ok ( PythonImplementation :: CPython ) ,
825828 "PyPy" => Ok ( PythonImplementation :: PyPy ) ,
826829 "GraalVM" => Ok ( PythonImplementation :: GraalPy ) ,
830+ "RustPython" => Ok ( PythonImplementation :: RustPython ) ,
827831 _ => bail ! ( "unknown interpreter: {}" , s) ,
828832 }
829833 }
@@ -1768,6 +1772,7 @@ fn default_lib_name_unix(
17681772 } ,
17691773
17701774 PythonImplementation :: GraalPy => Ok ( "python-native" . to_string ( ) ) ,
1775+ PythonImplementation :: RustPython => Ok ( "rustpython-capi" . to_string ( ) ) ,
17711776 }
17721777}
17731778
0 commit comments