Fixed error string when failing to import an exception (#4012)

This commit is contained in:
Alex Gaynor 2024-03-29 11:49:50 -04:00 committed by GitHub
parent 60e3f44dcf
commit ae3ac7d872
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
Fixed the error message when a class referenced in `pyo3::import_exception!` does not exist

View File

@ -123,7 +123,7 @@ macro_rules! import_exception {
::std::panic!("Can not import module {}: {}\n{}", stringify!($module), err, traceback); ::std::panic!("Can not import module {}: {}\n{}", stringify!($module), err, traceback);
}); });
let cls = imp.getattr(stringify!($name)).expect(concat!( let cls = imp.getattr(stringify!($name)).expect(concat!(
"Can not load exception class: {}.{}", "Can not load exception class: ",
stringify!($module), stringify!($module),
".", ".",
stringify!($name) stringify!($name)