-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error_already_set::what() is now constructed lazily #1895
Commits on Aug 28, 2019
-
error_already_set::what() is now constructed lazily
Prior to this commit throwing error_already_set was expensive due to the eager construction of the error string (which required traversing the Python stack). See pybind#1853 for more context and an alternative take on the issue. Note that error_already_set no longer inherits from std::runtime_error because the latter has no default constructor.
Configuration menu - View commit details
-
Copy full SHA for 87d1f6b - Browse repository at this point
Copy the full SHA 87d1f6bView commit details -
Do not attempt to normalize if no exception occurred
This is not supported on PyPy-2.7 5.8.0.
Configuration menu - View commit details
-
Copy full SHA for e289e0e - Browse repository at this point
Copy the full SHA e289e0eView commit details -
Extract exception name via tp_name
This is faster than dynamically looking up __name__ via GetAttrString. Note though that the runtime of the code throwing an error_already_set will be dominated by stack unwinding so the improvement will not be noticeable. Before: 396 ns ± 0.913 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) After: 277 ns ± 0.549 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) Benchmark: const std::string foo() { PyErr_SetString(PyExc_KeyError, ""); const std::string &s = py::detail::error_string(); PyErr_Clear(); return s; } PYBIND11_MODULE(foo, m) { m.def("foo", &::foo); }
Configuration menu - View commit details
-
Copy full SHA for f1435c7 - Browse repository at this point
Copy the full SHA f1435c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 60df143 - Browse repository at this point
Copy the full SHA 60df143View commit details -
Revert "Extract exception name via tp_name"
The implementation of __name__ is slightly more complex than that. It handles the module name prefix, and heap-allocated types. We could port it to pybind11 later on but for now it seems like an overkill. This reverts commit f1435c7.
Configuration menu - View commit details
-
Copy full SHA for c935b73 - Browse repository at this point
Copy the full SHA c935b73View commit details
Commits on Aug 29, 2019
-
Cosmit following @YannickJadoul's comments
Note that detail::error_string() no longer calls PyException_SetTraceback as it is unncessary for pretty-printing the exception.
Configuration menu - View commit details
-
Copy full SHA for b48bc72 - Browse repository at this point
Copy the full SHA b48bc72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 115a757 - Browse repository at this point
Copy the full SHA 115a757View commit details -
Configuration menu - View commit details
-
Copy full SHA for db14dd9 - Browse repository at this point
Copy the full SHA db14dd9View commit details
Commits on Feb 13, 2022
-
Merge branch 'master' of https://github.com/pybind/pybind11 into lazy…
…-error-string
Configuration menu - View commit details
-
Copy full SHA for 9635e88 - Browse repository at this point
Copy the full SHA 9635e88View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbb3e6b - Browse repository at this point
Copy the full SHA dbb3e6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a692362 - Browse repository at this point
Copy the full SHA a692362View commit details -
Configuration menu - View commit details
-
Copy full SHA for ff3185e - Browse repository at this point
Copy the full SHA ff3185eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 95eeaef - Browse repository at this point
Copy the full SHA 95eeaefView commit details -
Configuration menu - View commit details
-
Copy full SHA for 00e4852 - Browse repository at this point
Copy the full SHA 00e4852View commit details -
Configuration menu - View commit details
-
Copy full SHA for 648e670 - Browse repository at this point
Copy the full SHA 648e670View commit details -
Configuration menu - View commit details
-
Copy full SHA for 244aa52 - Browse repository at this point
Copy the full SHA 244aa52View commit details -
Configuration menu - View commit details
-
Copy full SHA for b09f14d - Browse repository at this point
Copy the full SHA b09f14dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d1ec9e - Browse repository at this point
Copy the full SHA 1d1ec9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d0354b - Browse repository at this point
Copy the full SHA 6d0354bView commit details
Commits on Feb 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2c5ad0b - Browse repository at this point
Copy the full SHA 2c5ad0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 68b349a - Browse repository at this point
Copy the full SHA 68b349aView commit details
Commits on Feb 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 91bf33f - Browse repository at this point
Copy the full SHA 91bf33fView commit details -
Merge branch 'master' of https://github.com/pybind/pybind11 into lazy…
…-error-string
Configuration menu - View commit details
-
Copy full SHA for 63dfbb4 - Browse repository at this point
Copy the full SHA 63dfbb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for d231f15 - Browse repository at this point
Copy the full SHA d231f15View commit details -
Configuration menu - View commit details
-
Copy full SHA for df6cb30 - Browse repository at this point
Copy the full SHA df6cb30View commit details
Commits on Feb 16, 2022
-
Configuration menu - View commit details
-
Copy full SHA for bdcd95a - Browse repository at this point
Copy the full SHA bdcd95aView commit details
Commits on Feb 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 225dbae - Browse repository at this point
Copy the full SHA 225dbaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for f8d3ed2 - Browse repository at this point
Copy the full SHA f8d3ed2View commit details
Commits on Feb 22, 2022
-
Configuration menu - View commit details
-
Copy full SHA for b90bd78 - Browse repository at this point
Copy the full SHA b90bd78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3286964 - Browse repository at this point
Copy the full SHA 3286964View commit details -
Configuration menu - View commit details
-
Copy full SHA for 978bf2a - Browse repository at this point
Copy the full SHA 978bf2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c97e68 - Browse repository at this point
Copy the full SHA 6c97e68View commit details
Commits on Mar 2, 2022
-
Merge branch 'master' of https://github.com/pybind/pybind11 into lazy…
…-error-string
Configuration menu - View commit details
-
Copy full SHA for 6523bc2 - Browse repository at this point
Copy the full SHA 6523bc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c6971f - Browse repository at this point
Copy the full SHA 6c6971fView commit details
Commits on Apr 23, 2022
-
t pushMerge branch 'master' of https://github.com/pybind/pybind11 int…
…o lazy-error-string
Configuration menu - View commit details
-
Copy full SHA for 98aff18 - Browse repository at this point
Copy the full SHA 98aff18View commit details
Commits on Apr 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for e71d9b9 - Browse repository at this point
Copy the full SHA e71d9b9View commit details
Commits on May 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for e9a2e6d - Browse repository at this point
Copy the full SHA e9a2e6dView commit details
Commits on May 4, 2022
-
Merge branch 'master' of https://github.com/pybind/pybind11 into lazy…
…-error-string
Configuration menu - View commit details
-
Copy full SHA for a83028c - Browse repository at this point
Copy the full SHA a83028cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e0d8d0e - Browse repository at this point
Copy the full SHA e0d8d0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d32bc91 - Browse repository at this point
Copy the full SHA d32bc91View commit details
Commits on May 5, 2022
-
Merge branch 'master' into lazy-error-string
Ralf W. Grosse-Kunstleve committedMay 5, 2022 Configuration menu - View commit details
-
Copy full SHA for 226cdde - Browse repository at this point
Copy the full SHA 226cddeView commit details -
Report "FATAL failure building pybind11::error_already_set error_stri…
…ng" and terminate process.
Ralf W. Grosse-Kunstleve committedMay 5, 2022 Configuration menu - View commit details
-
Copy full SHA for f4a440a - Browse repository at this point
Copy the full SHA f4a440aView commit details
Commits on May 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 8f6ab3f - Browse repository at this point
Copy the full SHA 8f6ab3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4da9968 - Browse repository at this point
Copy the full SHA 4da9968View commit details -
Configuration menu - View commit details
-
Copy full SHA for f181dac - Browse repository at this point
Copy the full SHA f181dacView commit details
Commits on May 8, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 6e781a0 - Browse repository at this point
Copy the full SHA 6e781a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f8f0ab - Browse repository at this point
Copy the full SHA 1f8f0abView commit details -
Merge branch 'master' of https://github.com/pybind/pybind11 into lazy…
…-error-string
Configuration menu - View commit details
-
Copy full SHA for 2031225 - Browse repository at this point
Copy the full SHA 2031225View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0aee425 - Browse repository at this point
Copy the full SHA 0aee425View commit details
Commits on May 10, 2022
-
Merge branch 'master' into lazy-error-string
Ralf W. Grosse-Kunstleve committedMay 10, 2022 Configuration menu - View commit details
-
Copy full SHA for 1c8398f - Browse repository at this point
Copy the full SHA 1c8398fView commit details -
Merge branch 'lazy-error-string' of https://github.com/superbobry/pyb…
…ind11 into lazy-error-string
Ralf W. Grosse-Kunstleve committedMay 10, 2022 Configuration menu - View commit details
-
Copy full SHA for a8f7a97 - Browse repository at this point
Copy the full SHA a8f7a97View commit details -
detail::obj_class_name(), fprintf with [STDERR], [STDOUT] tags, polis…
…h comments
Ralf W. Grosse-Kunstleve committedMay 10, 2022 Configuration menu - View commit details
-
Copy full SHA for 0691d5f - Browse repository at this point
Copy the full SHA 0691d5fView commit details
Commits on May 11, 2022
-
consistently check m_lazy_what.empty() also in production builds
Ralf W. Grosse-Kunstleve committedMay 11, 2022 Configuration menu - View commit details
-
Copy full SHA for 28de959 - Browse repository at this point
Copy the full SHA 28de959View commit details -
Make a comment slightly less ambiguous.
Ralf W. Grosse-Kunstleve committedMay 11, 2022 Configuration menu - View commit details
-
Copy full SHA for c7a7146 - Browse repository at this point
Copy the full SHA c7a7146View commit details -
Bug fix: Remove
what();
fromrestore()
.It sure would need to be guarded by `if (m_type)`, otherwise `what()` fails and masks that no error was set (see update unit test). But since `error_already_set` is copyable, there is no point in releasing m_type, m_value, m_trace, therefore we can just as well avoid the runtime overhead of force-building `m_lazy_what`, it may never be used.
Ralf W. Grosse-Kunstleve committedMay 11, 2022 Configuration menu - View commit details
-
Copy full SHA for de84a27 - Browse repository at this point
Copy the full SHA de84a27View commit details -
Replace extremely opaque (unhelpful) error message with a truthful re…
…flection of what we know.
Ralf W. Grosse-Kunstleve committedMay 11, 2022 Configuration menu - View commit details
-
Copy full SHA for 498195a - Browse repository at this point
Copy the full SHA 498195aView commit details -
Fix clang-tidy error [performance-move-constructor-init].
Ralf W. Grosse-Kunstleve committedMay 11, 2022 Configuration menu - View commit details
-
Copy full SHA for 80b05ba - Browse repository at this point
Copy the full SHA 80b05baView commit details -
Make expected error message less specific.
Ralf W. Grosse-Kunstleve committedMay 11, 2022 Configuration menu - View commit details
-
Copy full SHA for acdf332 - Browse repository at this point
Copy the full SHA acdf332View commit details -
Ralf W. Grosse-Kunstleve committed
May 11, 2022 Configuration menu - View commit details
-
Copy full SHA for 58ad49b - Browse repository at this point
Copy the full SHA 58ad49bView commit details -
bug fix: error_string(PyObject **, ...)
Ralf W. Grosse-Kunstleve committedMay 11, 2022 Configuration menu - View commit details
-
Copy full SHA for 90b2453 - Browse repository at this point
Copy the full SHA 90b2453View commit details
Commits on May 12, 2022
-
Putting back the two eager PyErr_NormalizeException() calls.
Ralf W. Grosse-Kunstleve committedMay 12, 2022 Configuration menu - View commit details
-
Copy full SHA for dded024 - Browse repository at this point
Copy the full SHA dded024View commit details -
Change error_already_set() to call pybind11_fail() if the Python erro…
…r indicator not set. The net result is that a std::runtime_error is thrown instead of error_already_set, but all tests pass as is.
Ralf W. Grosse-Kunstleve committedMay 12, 2022 Configuration menu - View commit details
-
Copy full SHA for 4193375 - Browse repository at this point
Copy the full SHA 4193375View commit details -
Remove mutable (fixes oversight in the previous commit).
Ralf W. Grosse-Kunstleve committedMay 12, 2022 Configuration menu - View commit details
-
Copy full SHA for b020e04 - Browse repository at this point
Copy the full SHA b020e04View commit details -
Normalize the exception only locally in error_string(). Python 3.6 & …
…3.7 test failures expected. This is meant for benchmarking, to determine if it is worth the trouble looking into the failures.
Ralf W. Grosse-Kunstleve committedMay 12, 2022 Configuration menu - View commit details
-
Copy full SHA for 02df6c0 - Browse repository at this point
Copy the full SHA 02df6c0View commit details -
Ralf W. Grosse-Kunstleve committed
May 12, 2022 Configuration menu - View commit details
-
Copy full SHA for d28c155 - Browse repository at this point
Copy the full SHA d28c155View commit details -
Use
gil_scoped_acquire_local
inerror_already_set
destructor. See…… long comment.
Ralf W. Grosse-Kunstleve committedMay 12, 2022 Configuration menu - View commit details
-
Copy full SHA for 7578de9 - Browse repository at this point
Copy the full SHA 7578de9View commit details -
For Python < 3.8:
PyErr_NormalizeException
before `PyErr_WriteUnrai……sable`
Ralf W. Grosse-Kunstleve committedMay 12, 2022 Configuration menu - View commit details
-
Copy full SHA for bab6f66 - Browse repository at this point
Copy the full SHA bab6f66View commit details
Commits on May 13, 2022
-
Go back to replacing the held Python exception with then normalized e…
…xception, if & when needed. Consistently document the side-effect.
Ralf W. Grosse-Kunstleve committedMay 13, 2022 Configuration menu - View commit details
-
Copy full SHA for 2ad2285 - Browse repository at this point
Copy the full SHA 2ad2285View commit details -
Slightly rewording comment. (There were also other failures.)
Ralf W. Grosse-Kunstleve committedMay 13, 2022 Configuration menu - View commit details
-
Copy full SHA for e3ebb0d - Browse repository at this point
Copy the full SHA e3ebb0dView commit details -
Add 1-line comment for obj_class_name()
Ralf W. Grosse-Kunstleve committedMay 13, 2022 Configuration menu - View commit details
-
Copy full SHA for 8dff51d - Browse repository at this point
Copy the full SHA 8dff51dView commit details -
Benchmark code, with results in this commit message.
function #calls test time [s] μs / call master pure_unwind 729540 1.061 14.539876 err_set_unwind_err_clear 681476 1.040 15.260282 err_set_error_already_set 508038 1.049 20.640525 error_already_set_restore 555578 1.052 18.933288 pr1895_original_foo 244113 1.050 43.018168 PR / master PR pybind#1895 pure_unwind 736981 1.054 14.295685 98.32% err_set_unwind_err_clear 685820 1.045 15.237399 99.85% err_set_error_already_set 661374 1.046 15.811879 76.61% error_already_set_restore 669881 1.048 15.645176 82.63% pr1895_original_foo 318243 1.059 33.290806 77.39% master @ commit ad146b2 Running tests in directory "/usr/local/google/home/rwgk/forked/pybind11/tests": ============================= test session starts ============================== platform linux -- Python 3.9.10, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /usr/local/google/home/rwgk/forked/pybind11/tests, configfile: pytest.ini collecting ... collected 5 items test_perf_error_already_set.py::test_perf[pure_unwind] PERF pure_unwind,729540,1.061,14.539876 PASSED test_perf_error_already_set.py::test_perf[err_set_unwind_err_clear] PERF err_set_unwind_err_clear,681476,1.040,15.260282 PASSED test_perf_error_already_set.py::test_perf[err_set_error_already_set] PERF err_set_error_already_set,508038,1.049,20.640525 PASSED test_perf_error_already_set.py::test_perf[error_already_set_restore] PERF error_already_set_restore,555578,1.052,18.933288 PASSED test_perf_error_already_set.py::test_perf[pr1895_original_foo] PERF pr1895_original_foo,244113,1.050,43.018168 PASSED ============================== 5 passed in 12.38s ============================== pr1895 @ commit 8dff51d Running tests in directory "/usr/local/google/home/rwgk/forked/pybind11/tests": ============================= test session starts ============================== platform linux -- Python 3.9.10, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /usr/local/google/home/rwgk/forked/pybind11/tests, configfile: pytest.ini collecting ... collected 5 items test_perf_error_already_set.py::test_perf[pure_unwind] PERF pure_unwind,736981,1.054,14.295685 PASSED test_perf_error_already_set.py::test_perf[err_set_unwind_err_clear] PERF err_set_unwind_err_clear,685820,1.045,15.237399 PASSED test_perf_error_already_set.py::test_perf[err_set_error_already_set] PERF err_set_error_already_set,661374,1.046,15.811879 PASSED test_perf_error_already_set.py::test_perf[error_already_set_restore] PERF error_already_set_restore,669881,1.048,15.645176 PASSED test_perf_error_already_set.py::test_perf[pr1895_original_foo] PERF pr1895_original_foo,318243,1.059,33.290806 PASSED ============================== 5 passed in 12.40s ============================== clang++ -o pybind11/tests/test_perf_error_already_set.os -c -std=c++17 -fPIC -fvisibility=hidden -Os -flto -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -Wnon-virtual-dtor -Wunused-result -isystem /usr/include/python3.9 -isystem /usr/include/eigen3 -DPYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX -DPYBIND11_TEST_BOOST -Ipybind11/include -I/usr/local/google/home/rwgk/forked/pybind11/include -I/usr/local/google/home/rwgk/clone/pybind11/include /usr/local/google/home/rwgk/forked/pybind11/tests/test_perf_error_already_set.cpp clang++ -o lib/pybind11_tests.so -shared -fPIC -Os -flto -shared ... Debian clang version 13.0.1-3+build2 Target: x86_64-pc-linux-gnu Thread model: posix
Ralf W. Grosse-Kunstleve committedMay 13, 2022 Configuration menu - View commit details
-
Copy full SHA for 923725a - Browse repository at this point
Copy the full SHA 923725aView commit details -
Changing call_repetitions_target_elapsed_secs to 0.1 for regular unit…
… testing.
Ralf W. Grosse-Kunstleve committedMay 13, 2022 Configuration menu - View commit details
-
Copy full SHA for 53f40a0 - Browse repository at this point
Copy the full SHA 53f40a0View commit details
Commits on May 14, 2022
-
Ralf W. Grosse-Kunstleve committed
May 14, 2022 Configuration menu - View commit details
-
Copy full SHA for b77e703 - Browse repository at this point
Copy the full SHA b77e703View commit details -
Configuration menu - View commit details
-
Copy full SHA for 493d751 - Browse repository at this point
Copy the full SHA 493d751View commit details -
Merge branch 'lazy-error-string' of https://github.com/superbobry/pyb…
…ind11 into lazy-error-string
Configuration menu - View commit details
-
Copy full SHA for 6d0ec49 - Browse repository at this point
Copy the full SHA 6d0ec49View commit details
Commits on May 15, 2022
-
Fix silly bug in recurse_first_then_call()
Ralf W. Grosse-Kunstleve committedMay 15, 2022 Configuration menu - View commit details
-
Copy full SHA for 6d9188f - Browse repository at this point
Copy the full SHA 6d9188fView commit details -
Add tests that have equivalent PyErr_Fetch(), PyErr_Restore() but no …
…try-catch.
Ralf W. Grosse-Kunstleve committedMay 15, 2022 Configuration menu - View commit details
-
Copy full SHA for 8f3d3a6 - Browse repository at this point
Copy the full SHA 8f3d3a6View commit details -
Add call_error_string to tests. Sample only recursion_depth 0, 100.
Ralf W. Grosse-Kunstleve committedMay 15, 2022 Configuration menu - View commit details
-
Copy full SHA for 724ee3d - Browse repository at this point
Copy the full SHA 724ee3dView commit details -
Show lazy-what speed-up in percent.
Ralf W. Grosse-Kunstleve committedMay 15, 2022 Configuration menu - View commit details
-
Copy full SHA for 467ab00 - Browse repository at this point
Copy the full SHA 467ab00View commit details -
Include real_work in benchmarks.
Ralf W. Grosse-Kunstleve committedMay 15, 2022 Configuration menu - View commit details
-
Copy full SHA for eaa1a48 - Browse repository at this point
Copy the full SHA eaa1a48View commit details
Commits on May 16, 2022
-
Replace all PyErr_SetString() with generate_python_exception_with_tra…
…ceback()
Ralf W. Grosse-Kunstleve committedMay 16, 2022 Configuration menu - View commit details
-
Copy full SHA for dbed20a - Browse repository at this point
Copy the full SHA dbed20aView commit details -
Better organization of test loops.
Ralf W. Grosse-Kunstleve committedMay 16, 2022 Configuration menu - View commit details
-
Copy full SHA for f021543 - Browse repository at this point
Copy the full SHA f021543View commit details -
Add test_error_already_set_copy_move
Ralf W. Grosse-Kunstleve committedMay 16, 2022 Configuration menu - View commit details
-
Copy full SHA for 125e2d0 - Browse repository at this point
Copy the full SHA 125e2d0View commit details -
Fix bug in newly added test (discovered by clang-tidy): actually use …
…move ctor
Ralf W. Grosse-Kunstleve committedMay 16, 2022 Configuration menu - View commit details
-
Copy full SHA for b037958 - Browse repository at this point
Copy the full SHA b037958View commit details -
MSVC detects the unreachable return
Ralf W. Grosse-Kunstleve committedMay 16, 2022 Configuration menu - View commit details
-
Copy full SHA for 2baa3bc - Browse repository at this point
Copy the full SHA 2baa3bcView commit details
Commits on May 17, 2022
-
change test_perf_error_already_set.py back to quick mode
Ralf W. Grosse-Kunstleve committedMay 17, 2022 Configuration menu - View commit details
-
Copy full SHA for 4c479f4 - Browse repository at this point
Copy the full SHA 4c479f4View commit details -
Inherit from std::exception (instead of std::runtime_error, which doe…
…s not make sense anymore with the lazy what)
Ralf W. Grosse-Kunstleve committedMay 17, 2022 2Configuration menu - View commit details
-
Copy full SHA for b4326f9 - Browse repository at this point
Copy the full SHA b4326f9View commit details -
Special handling under Windows.
Ralf W. Grosse-Kunstleve committedMay 17, 2022 Configuration menu - View commit details
-
Copy full SHA for aaec34e - Browse repository at this point
Copy the full SHA aaec34eView commit details -
Ralf W. Grosse-Kunstleve committed
May 17, 2022 Configuration menu - View commit details
-
Copy full SHA for 99af318 - Browse repository at this point
Copy the full SHA 99af318View commit details -
Merge branch 'master' into lazy-error-string
Ralf W. Grosse-Kunstleve committedMay 17, 2022 Configuration menu - View commit details
-
Copy full SHA for e5f028f - Browse repository at this point
Copy the full SHA e5f028fView commit details
Commits on May 18, 2022
-
Removing test_perf_error_already_set (copies are under rwgk/rwgk_tbx@7…
…765113).
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 8c76360 - Browse repository at this point
Copy the full SHA 8c76360View commit details -
Avoid gil and scope overhead if there is nothing to release.
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for c7149d8 - Browse repository at this point
Copy the full SHA c7149d8View commit details -
Restore default move ctor. "member function" instead of "function" (n…
…ote that "method" is Python terminology).
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 47f5445 - Browse repository at this point
Copy the full SHA 47f5445View commit details -
Delete error_already_set copy ctor.
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 7c08e7f - Browse repository at this point
Copy the full SHA 7c08e7fView commit details -
Make restore() non-const again to resolve clang-tidy failure (still e…
…xperimenting).
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for f746a3d - Browse repository at this point
Copy the full SHA f746a3dView commit details -
Bring back error_already_set copy ctor, to see if that resolves the 4…
… MSVC test failures.
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 25e4cc9 - Browse repository at this point
Copy the full SHA 25e4cc9View commit details -
Add noexcept to error_already_set copy & move ctors (as suggested by @…
…Skylion007 IIUC).
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 70b870a - Browse repository at this point
Copy the full SHA 70b870aView commit details -
Trying one-by-one noexcept copy ctor for old compilers.
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for d425bb8 - Browse repository at this point
Copy the full SHA d425bb8View commit details -
Add back test covering copy ctor. Add another simple test that exerci…
…ses the copy ctor.
Ralf W. Grosse-Kunstleve committedMay 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 65aaa4c - Browse repository at this point
Copy the full SHA 65aaa4cView commit details
Commits on May 19, 2022
-
Exclude more older compilers from using the noexcept = default ctors.…
… (The tests in the previous commit exposed that those are broken.)
Ralf W. Grosse-Kunstleve committedMay 19, 2022 Configuration menu - View commit details
-
Copy full SHA for 19bb595 - Browse repository at this point
Copy the full SHA 19bb595View commit details -
Factor out & reuse gil_scoped_acquire_local as gil_scoped_acquire_simple
Ralf W. Grosse-Kunstleve committedMay 19, 2022 Configuration menu - View commit details
-
Copy full SHA for d07b5ba - Browse repository at this point
Copy the full SHA d07b5baView commit details -
Guard gil_scoped_acquire_simple by _Py_IsFinalizing() check.
Ralf W. Grosse-Kunstleve committedMay 19, 2022 Configuration menu - View commit details
-
Copy full SHA for f6bf5aa - Browse repository at this point
Copy the full SHA f6bf5aaView commit details -
Ralf W. Grosse-Kunstleve committed
May 19, 2022 Configuration menu - View commit details
-
Copy full SHA for cc5d76a - Browse repository at this point
Copy the full SHA cc5d76aView commit details -
Ralf W. Grosse-Kunstleve committed
May 19, 2022 Configuration menu - View commit details
-
Copy full SHA for 2b31e4d - Browse repository at this point
Copy the full SHA 2b31e4dView commit details
Commits on May 20, 2022
-
Merge branch 'master' into lazy-error-string
Ralf W. Grosse-Kunstleve committedMay 20, 2022 Configuration menu - View commit details
-
Copy full SHA for 73cffe4 - Browse repository at this point
Copy the full SHA 73cffe4View commit details -
Use
gil_scoped_acquire
in dtor, copy ctor,what()
. Remove `_Py_Is……Finalizing()` checks (they are racy: python/cpython#28525).
Ralf W. Grosse-Kunstleve committedMay 20, 2022 6Configuration menu - View commit details
-
Copy full SHA for 2c5dd19 - Browse repository at this point
Copy the full SHA 2c5dd19View commit details
Commits on May 21, 2022
-
Remove error_scope from copy ctor.
Ralf W. Grosse-Kunstleve committedMay 21, 2022 Configuration menu - View commit details
-
Copy full SHA for 14be38c - Browse repository at this point
Copy the full SHA 14be38cView commit details -
Add
error_scope
toget_internals()
, to cover the situation that `……get_internals()` is called from the `error_already_set` dtor while a new Python error is in flight already. Also backing out `gil_scoped_acquire_simple` change.
Ralf W. Grosse-Kunstleve committedMay 21, 2022 Configuration menu - View commit details
-
Copy full SHA for db97ce7 - Browse repository at this point
Copy the full SHA db97ce7View commit details
Commits on May 23, 2022
-
Add
FlakyException
tests with failure triggers in__init__
and `_……_str__` THIS IS STILL A WORK IN PROGRESS. This commit is only an important resting point. This commit is a first attempt at addressing the observation that `PyErr_NormalizeException()` completely replaces the original exception if `__init__` fails. This can be very confusing even in small applications, and extremely confusing in large ones.
Ralf W. Grosse-Kunstleve committedMay 23, 2022 Configuration menu - View commit details
-
Copy full SHA for 42d2e1a - Browse repository at this point
Copy the full SHA 42d2e1aView commit details
Commits on May 24, 2022
-
Tweaks to resolve Py 3.6 and PyPy CI failures.
Ralf W. Grosse-Kunstleve committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for 6417a76 - Browse repository at this point
Copy the full SHA 6417a76View commit details -
Normalize Python exception immediately in error_already_set ctor.
For background see: pybind#1895 (comment)
Ralf W. Grosse-Kunstleve committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for a62b3d7 - Browse repository at this point
Copy the full SHA a62b3d7View commit details -
Merge branch 'master' into lazy-error-string
Ralf W. Grosse-Kunstleve committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for c54309c - Browse repository at this point
Copy the full SHA c54309cView commit details -
Fix oversights based on CI failures (copy & move ctor initialization).
Ralf W. Grosse-Kunstleve committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for c786796 - Browse repository at this point
Copy the full SHA c786796View commit details -
Move @pytest.mark.xfail("env.PYPY") after @pytest.mark.parametrize(...)
Ralf W. Grosse-Kunstleve committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for 61bb513 - Browse repository at this point
Copy the full SHA 61bb513View commit details -
Use @pytest.mark.skipif (xfail does not work for segfaults, of course).
Ralf W. Grosse-Kunstleve committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for bb3f24c - Browse repository at this point
Copy the full SHA bb3f24cView commit details
Commits on May 31, 2022
-
Merge branch 'master' into lazy-error-string
Ralf W. Grosse-Kunstleve committedMay 31, 2022 Configuration menu - View commit details
-
Copy full SHA for 087ef29 - Browse repository at this point
Copy the full SHA 087ef29View commit details
Commits on Jun 1, 2022
-
Remove unused obj_class_name_or() function (it was added only under t…
…his PR).
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for bee5fb4 - Browse repository at this point
Copy the full SHA bee5fb4View commit details -
Remove already obsolete C++ comments and code that were added only un…
…der this PR.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for bea0c9f - Browse repository at this point
Copy the full SHA bea0c9fView commit details -
Slightly better (newly added) comments.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for d6d371a - Browse repository at this point
Copy the full SHA d6d371aView commit details -
Factor out detail::error_fetch_and_normalize. Preparation for produci…
…ng identical results from error_already_set::what() and detail::error_string(). Note that this is a very conservative refactoring. It would be much better to first move detail::error_string into detail/error_string.h
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for eec0547 - Browse repository at this point
Copy the full SHA eec0547View commit details -
Copy most of error_string() code to new error_fetch_and_normalize::co…
…mplete_lazy_error_string()
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for ec1a2c0 - Browse repository at this point
Copy the full SHA ec1a2c0View commit details -
Remove all error_string() code from detail/type_caster_base.h. Note t…
…hat this commit includes a subtle bug fix: previously error_string() restored the Python error, which will upset pybind11_fail(). This never was a problem in practice because the two PyType_Ready() calls in detail/class.h do not usually fail.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for c39ebd5 - Browse repository at this point
Copy the full SHA c39ebd5View commit details -
Return const std::string& instead of const char * and move error_stri…
…ng() to pytypes.h
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 286023b - Browse repository at this point
Copy the full SHA 286023bView commit details -
Remove gil_scope_acquire from error_fetch_and_normalize, add back to …
…error_already_set
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 156b57b - Browse repository at this point
Copy the full SHA 156b57bView commit details -
Better handling of FlakyException __str__ failure.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 6f175ac - Browse repository at this point
Copy the full SHA 6f175acView commit details -
Move error_fetch_and_normalize::complete_lazy_error_string() implemen…
…tation from pybind11.h to pytypes.h
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 71f33a8 - Browse repository at this point
Copy the full SHA 71f33a8View commit details -
Add error_fetch_and_normalize::release_py_object_references() and use…
… from error_already_set dtor.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 0739d4c - Browse repository at this point
Copy the full SHA 0739d4cView commit details -
Use shared_ptr for m_fetched_error => 1. non-racy, copy ctor that doe…
…s not need the GIL; 2. enables guard against duplicate restore() calls.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 80dfaea - Browse repository at this point
Copy the full SHA 80dfaeaView commit details -
Ralf W. Grosse-Kunstleve committed
Jun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for a7ba693 - Browse repository at this point
Copy the full SHA a7ba693View commit details -
Trivial renaming of a newly introduced member function.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 9854589 - Browse repository at this point
Copy the full SHA 9854589View commit details -
Merge branch 'master' into lazy-error-string
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for d2e78b0 - Browse repository at this point
Copy the full SHA d2e78b0View commit details -
Ralf W. Grosse-Kunstleve committed
Jun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 0e50c45 - Browse repository at this point
Copy the full SHA 0e50c45View commit details -
Bug fix (oversight). Only valgrind got this one.
Ralf W. Grosse-Kunstleve committedJun 1, 2022 Configuration menu - View commit details
-
Copy full SHA for 4e06fb1 - Browse repository at this point
Copy the full SHA 4e06fb1View commit details
Commits on Jun 2, 2022
-
Use shared_ptr custom deleter for m_fetched_error in error_already_se…
…t. This enables removing the dtor, copy ctor, move ctor completely.
Ralf W. Grosse-Kunstleve committedJun 2, 2022 Configuration menu - View commit details
-
Copy full SHA for f892cce - Browse repository at this point
Copy the full SHA f892cceView commit details -
Further small simplification. With the GIL held, simply deleting the …
…raw_ptr takes care of everything.
Ralf W. Grosse-Kunstleve committedJun 2, 2022 Configuration menu - View commit details
-
Copy full SHA for 53e29f4 - Browse repository at this point
Copy the full SHA 53e29f4View commit details -
``` iwyu version: include-what-you-use 0.17 based on Debian clang version 13.0.1-3+build2 ``` Command used: ``` iwyu -c -std=c++17 -DPYBIND11_TEST_BOOST -Iinclude/pybind11 -I/usr/include/python3.9 -I/usr/include/eigen3 include/pybind11/pytypes.cpp ``` pytypes.cpp is a temporary file: `#include "pytypes.h"` The raw output is very long and noisy. I decided to use `#include <cstddef>` instead of `#include <cstdio>` for `std::size_t` (iwyu sticks to the manual choice). I ignored all iwyu suggestions that are indirectly covered by `#include <Python.h>`. I manually verified that all added includes are actually needed.
Ralf W. Grosse-Kunstleve committedJun 2, 2022 Configuration menu - View commit details
-
Copy full SHA for 8e145c0 - Browse repository at this point
Copy the full SHA 8e145c0View commit details