mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
fix: avoid catch (...) for expected import numpy failures (#3974)
* Replace import numpy catch (...) with catch (error_already_set) * Add missing const (not sure how those got lost).
This commit is contained in:
committed by
GitHub
parent
2c549eb7aa
commit
8d14e666e3
@@ -22,7 +22,7 @@ double my_func(int x, float y, double z) {
|
||||
TEST_SUBMODULE(numpy_vectorize, m) {
|
||||
try {
|
||||
py::module_::import("numpy");
|
||||
} catch (...) {
|
||||
} catch (const py::error_already_set &) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user