Merge pull request #3249 from lucatrv/patch-1

Improve `PyModule::from_code` examples
This commit is contained in:
Adam Reichold 2023-06-17 10:48:50 +00:00 committed by GitHub
commit 7e61f18751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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(())