1. 31 Mar, 2020 1 commit
  2. 04 Mar, 2020 1 commit
  3. 22 Jan, 2020 1 commit
  4. 17 Jan, 2020 1 commit
  5. 05 Jan, 2020 2 commits
  6. 02 Jan, 2020 2 commits
    • Handle cases where binding code immediately throws py::error_already_set · bf2b0314
      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.
      Wenzel Jakob committed
  7. 31 Dec, 2019 1 commit
  8. 30 Dec, 2019 1 commit
    • Use C++17 fold expressions when casting tuples and argument lists (#2043) · f9f3bd71
      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.
      Wenzel Jakob committed
  9. 19 Dec, 2019 2 commits
  10. 13 Dec, 2019 1 commit
  11. 12 Dec, 2019 1 commit
  12. 11 Dec, 2019 4 commits
  13. 28 Nov, 2019 3 commits
  14. 25 Nov, 2019 2 commits
  15. 24 Nov, 2019 1 commit
  16. 16 Nov, 2019 1 commit
  17. 14 Nov, 2019 4 commits
  18. 31 Oct, 2019 2 commits
  19. 23 Oct, 2019 1 commit
  20. 22 Oct, 2019 2 commits
  21. 18 Oct, 2019 1 commit
  22. 17 Oct, 2019 1 commit
    • Fix build with -Wmissing-prototypes (#1954) · de5a29c0
      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.
      ```
      nicolov committed
  23. 14 Oct, 2019 2 commits
  24. 08 Oct, 2019 1 commit
  25. 06 Oct, 2019 1 commit