1. Mar 31, 2020
  2. Mar 04, 2020
  3. Jan 22, 2020
  4. Jan 17, 2020
  5. Jan 05, 2020
  6. Jan 03, 2020
    • Wenzel Jakob's avatar
      Handle cases where binding code immediately throws py::error_already_set · bf2b0314
      Wenzel Jakob authored
      When binding code immediately throws an exception of type
      py::error_already_set (e.g. via py::module::import that fails), the
      catch block sets an import error as expected. Unfortunately, following
      this, the deconstructor of py::error_already_set decides to call
      py::detail::get_internals() and set up various internal data structures
      of pybind11, which fails given that the error flag is active. The call
      stack of this looks as follows:
      
      Py_init_mymodule() -> __cxa_decrement_exception_refcount ->
      error_already_set::~error_already_set() ->
      gil_scoped_acquire::gil_scoped_acquire() -> detail::get_internals() ->
      ... -> pybind11::detail::simple_collector() -> uh oh..
      
      The solution is simple: we call detail::get_internals() once before
      running any binding code to make sure that the internal data structures
      are ready.
      bf2b0314
    • Wenzel Jakob's avatar
      bindings for import_error exception · 4c206e8c
      Wenzel Jakob authored
      4c206e8c
  7. Dec 31, 2019
  8. Dec 30, 2019
    • Wenzel Jakob's avatar
      Use C++17 fold expressions when casting tuples and argument lists (#2043) · f9f3bd71
      Wenzel Jakob authored
      This commit introduces the use of C++17-style fold expressions when
      casting tuples & the argument lists of functions.
      
      This change can improve performance of the resulting bindings: because
      fold expressions have short-circuiting semantics, pybind11 e.g. won't
      try to cast the second argument of a function if the first one failed.
      This is particularly effective when working with functions that have
      many overloads with long argument lists.
      f9f3bd71
  9. Dec 19, 2019
  10. Dec 13, 2019
  11. Dec 12, 2019
  12. Dec 11, 2019
  13. Nov 28, 2019
  14. Nov 25, 2019
  15. Nov 24, 2019
  16. Nov 16, 2019
  17. Nov 14, 2019
  18. Oct 31, 2019
  19. Oct 23, 2019
  20. Oct 22, 2019
  21. Oct 18, 2019
  22. Oct 17, 2019
    • nicolov's avatar
      Fix build with -Wmissing-prototypes (#1954) · de5a29c0
      nicolov authored
      When building with `-Werror,-Wmissing-prototypes`, `clang` complains about missing prototypes for functions defined through macro expansions. This PR adds the missing prototypes.
      
      ```
      error: no previous prototype for function 'pybind11_init_impl_embedded' [
      -Werror,-Wmissing-prototypes]                                           
      PYBIND11_EMBEDDED_MODULE(embedded, mod) {                                             
      ^                                                                           
      external/pybind11/include/pybind11/embed.h:61:5: note: expanded from macro 'PYBIND11_EMBEDDED_MODULE'
          PYBIND11_EMBEDDED_MODULE_IMPL(name)                                       \
          ^                                                                         
      external/pybind11/include/pybind11/embed.h:26:23: note: expanded from macro 'PYBIND11_EMBEDDED_MODULE_IMPL'
            extern "C" void pybind11_init_impl_##name() {      \                  
                            ^                                             
      <scratch space>:380:1: note: expanded from here                     
      pybind11_init_impl_embedded                                                                                                                      
      ^                                                                                                                                                
      1 error generated.
      ```
      de5a29c0
  23. Oct 15, 2019
  24. Oct 09, 2019
    • Sergei Izmailov's avatar
      Adapt to python3.8 C API change (#1950) · 6cb584e9
      Sergei Izmailov authored
      * Adapt to python3.8 C API change
      
      Do `Py_DECREF(type)` on all python objects on deallocation
      
      fix #1946
      
      * Add bare python3.8 build to CI matrix
      
      While numpy/scipy wheels are available, run python3.8 test without them
      6cb584e9
  25. Oct 07, 2019