Improve PyModule::from_code examples

This commit is contained in:
Luca Trevisani 2023-06-16 23:45:49 +02:00 committed by GitHub
parent 5b85c924dd
commit ab7a65cbb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,7 +98,7 @@ impl PyModule {
/// let code = include_str!("../../assets/script.py");
///
/// Python::with_gil(|py| -> PyResult<()> {
/// PyModule::from_code(py, code, "example", "example")?;
/// PyModule::from_code(py, code, "example.py", "example")?;
/// Ok(())
/// })?;
/// # Ok(())
@ -117,7 +117,7 @@ impl PyModule {
/// let code = std::fs::read_to_string("assets/script.py")?;
///
/// Python::with_gil(|py| -> PyResult<()> {
/// PyModule::from_code(py, &code, "example", "example")?;
/// PyModule::from_code(py, &code, "example.py", "example")?;
/// Ok(())
/// })?;
/// Ok(())