Skip to content

Commit

Permalink
Improved error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencilcaseman committed Aug 11, 2024
1 parent 93b2c9a commit 22f1e6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python_interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn load_program<'a, P: AsRef<Path> + std::fmt::Debug>(
let code = format!("import sys\nsys.path.append('{source_dir}')\n{file}");

PyModule::from_code_bound(*py, &code, "", "")
.map_err(|err| format!("Failed to load python program: {err}"))
.map_err(|err| format!("Failed to load python program '{path:?}': {err}"))
}

/// Extract a named attribute of a Python object.
Expand Down

0 comments on commit 22f1e6e

Please sign in to comment.