diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2021-01-02 10:15:39 +0100 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2021-01-02 10:15:39 +0100 |
commit | e76cdab6dd77bad411e6ac9372ee527aff89ef17 (patch) | |
tree | e9868f05cf455336d75f33b1312d71034f8fb334 /3rdparty/pybind11/tests/test_eval.cpp | |
parent | c6cdf30501dcb2da01361229dd66a05dad73a132 (diff) | |
download | nextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.tar.gz nextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.tar.bz2 nextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.zip |
Update pybind11 to version 2.6.1
Diffstat (limited to '3rdparty/pybind11/tests/test_eval.cpp')
-rw-r--r-- | 3rdparty/pybind11/tests/test_eval.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/3rdparty/pybind11/tests/test_eval.cpp b/3rdparty/pybind11/tests/test_eval.cpp index e0948219..5416c2ec 100644 --- a/3rdparty/pybind11/tests/test_eval.cpp +++ b/3rdparty/pybind11/tests/test_eval.cpp @@ -14,7 +14,7 @@ TEST_SUBMODULE(eval_, m) { // test_evals - auto global = py::dict(py::module::import("__main__").attr("__dict__")); + auto global = py::dict(py::module_::import("__main__").attr("__dict__")); m.def("test_eval_statements", [global]() { auto local = py::dict(); @@ -88,4 +88,12 @@ TEST_SUBMODULE(eval_, m) { } return false; }); + + // test_eval_empty_globals + m.def("eval_empty_globals", [](py::object global) { + if (global.is_none()) + global = py::dict(); + auto int_class = py::eval("isinstance(42, int)", global); + return global; + }); } |