Commit Graph

1599 Commits

Author SHA1 Message Date
Axel Huebl
1c627c9ec0 pybind11_getbuffer: useless safe nullptr check (#1664)
Alternative implementation for #1657: if
we know that `obj` is never a `nullptr` [1], we should
not `nullptr`-check it *after* already dereferencing it.

[1] https://github.com/pybind/pybind11/pull/1657#issuecomment-452090058
2019-06-10 22:18:11 +02:00
Jeffrey Quesnelle
f93cd0aa72 PYBIND11_TLS_REPLACE_VALUE should use macro argument value in Python 3.7+ (#1683) 2019-06-10 22:13:35 +02:00
Ivor Wanders
2b045757b5 Improve documentation related to inheritance. (#1676)
* Adds section to the reference.
* Adds section to advanced classes page describing how to use `get_overload`.
2019-06-10 22:12:28 +02:00
Manuel Schneider
492da592c2 another typo (#1675) 2019-06-10 22:05:12 +02:00
Axel Huebl
9424d5d277 type_record: Uninit Member (#1658)
Fix an uninitialized member in `type_record`.

Found with coverity in a downstream project.
2019-06-10 22:02:40 +02:00
Jörg Kreuzberger
69dc380c0d #1208 Handle forced unwind exception (e.g. during pthread termination)
* #1208 Bugfix thread kill wihile running pybind11 module

* #1208 Bugfix missing space after catch
2019-06-10 22:00:55 +02:00
Darius Arnold
09330b94ea Fix typos in documentation (#1635)
* Always capitalize Eigen

* Fix spelling
2019-06-10 21:57:00 +02:00
luzpaz
21bf16f5b8 misc. comment typo (#1629) 2019-06-10 21:56:38 +02:00
Omar Awile
ac6cb91a34 Fixed small typo (#1633)
I think this particular method binding should not be done with `PYBIND11_OVERLOAD_PURE` but instead `PYBIND11_OVERLOAD`.
2019-06-10 21:56:17 +02:00
Steven Johnson
4ddf7c402d Add missing includes for better Bazel compatibility (#1255)
Bazel has a "strict" build model that requires all C++ header files be compilable on their own, and thus must explicitly #include all headers they require (even if de facto header inclusion order means they'd get them "for free"). This adds a couple of headers that are needed (but missing) by this model.
2019-06-10 21:54:56 +02:00
Sergei Izmailov
979d75de23 doc: Add note about casting from None to T* (#1760)
* doc: Add note about casting from `None` to `T*`

* doc: reword 'none-to-pointer' note message

* doc: mention opaque types in 'none-to-pointer' note message
2019-06-10 21:03:17 +02:00
Blake Thompson
30c0352348 Added __contains__ to stl bindings for maps (#1767)
* Added __contains__ to stl bindings for maps
2019-06-10 21:01:11 +02:00
nstelzen
c251434011 Added note in documentation regarding make install (#1801)
* Added note regarding make install
2019-06-10 16:35:36 +02:00
Yannick Jadoul
97784dad3e [BUGFIX] Fixing pybind11::error_already_set.matches to also work with exception subclasses (#1715)
* Fixing order of arguments in call to PyErr_GivenExceptionMatches in pybind11::error_already_set.matches

* Added tests on error_already_set::matches fix for exception base classes
2019-05-12 23:35:49 +02:00
Jamie Snape
a0b8f70df4 Ensure PythonLibsNew_FOUND is set in FindPythonLibsNew module (#1373)
Since the module is named FindPythonLibsNew, PythonLibsNew_FOUND should be set appropriately.
2019-05-12 19:43:44 +02:00
Boris Staletic
b3f0b4de66 new sphinx (#1786) 2019-05-12 19:27:23 +02:00
martinRenou
35045eeef8 Add getters for exception type, value and traceback (#1641) 2019-05-03 14:32:28 +02:00
Henry Schreiner
9bb3313162 Fixing warnings about conversions in GCC 7+ (#1753) 2019-04-07 10:38:10 +02:00
Henry Schreiner
73b840dc34 Fix for issue in latest conda (#1757) 2019-04-07 10:37:21 +02:00
Henry Schreiner
ae951ca085 CI fixes (#1744)
* Fix warning that not including a cmake source or build dir will be a fatal error (it is now on newest CMakes)
    * Fixes appveyor
* Travis uses CMake 3.9 for more than a year now
* Travis dropped sudo: false in December
* Dropping Sphinx 2
- clang7: Suppress self-assign warnings; fix missing virtual dtors
- pypy:
  - Keep old version (newer stuff breaks)
  - Pin packages to extra index for speed
- travis:
  - Make docker explicit; remove docker if not needed
  - Make commands more verbose (for debugging / repro)
  - Make Ubuntu dist explicit per job
- Fix Windows
- Add names to travis
2019-04-06 19:09:39 +02:00
Wenzel Jakob
25abf7efba flake8 fixes 2019-02-04 17:09:47 +01:00
Wenzel Jakob
ccbe68b084 added binding delattr() -> PyObject_DelAttr analogous to hasattr() 2019-02-04 16:24:07 +01:00
Wenzel Jakob
d1f64fa920 AppVeyor: quench pip deprecation warnings for v2.7 2019-02-04 16:18:01 +01:00
Guilhem Saurel
43a39bc7d8 ignore numpy.ufunc size warnings 2019-02-04 16:09:21 +01:00
Guilhem Saurel
e7ef34f23f compatibility with pytest 4.0, fix #1670
Cf. https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace
2019-02-04 16:09:21 +01:00
Yannick Jadoul
085a29436a Increasing timeout in test_gil_scoped.py to get AppVeyor to succeed 2019-01-03 22:43:52 +01:00
Boris Staletic
0ca6867e8e Avoid Visual Studio 2017 15.9.4 ICE 2019-01-03 12:05:01 +01:00
Boris Staletic
f4b4e2e957 Use new Doxygen archive URL - fixes Travis 2019-01-03 12:05:01 +01:00
Borja Zarco
e2b884c33b Use PyGILState_GetThisThreadState when using gil_scoped_acquire. (#1211)
This avoids GIL deadlocking when pybind11 tries to acquire the GIL in a thread that already acquired it using standard Python API (e.g. when running from a Python thread).
2018-12-01 22:47:40 +09:00
Baljak
81da9888c7 Fix Intel C++ compiler warning on Windows (#1608) 2018-11-20 23:22:02 +01:00
Wenzel Jakob
64205140bd added std::deque to overview.rst
[ci skip]
2018-11-16 06:46:48 +01:00
voxmea
17983e7425 Adds type_caster support for std::deque. (#1609)
* Adds std::deque to the types supported by list_caster in stl.h.
* Adds a new test_deque test in test_stl.{py,cpp}.
* Updates the documentation to include std::deque as a default
  supported type.
2018-11-16 06:45:19 +01:00
Ahuva Kroizer
8f5b7fce84 FAQ addition (#1606)
* Add possible solution to ImportError issue
2018-11-13 13:25:57 +01:00
Karl Haubenwallner
e9d6e87949 Added a debug flag to the PYBIND11_INTERNALS_VERSION (#1549) 2018-11-11 20:49:33 +01:00
Trevor Laughlin
63c2a972fe Enable unique_ptr holder with mixed Deleters between base and derived types (#1353)
* Check default holder

-Recognize "std::unique_ptr<T, D>" as a default holder even if "D" doesn't match between base and derived holders

* Add test for unique_ptr<T, D> change
2018-11-11 19:36:55 +01:00
Wenzel Jakob
cea42467b0
fix py::cast<void *> (#1605)
Pybind11 provides a cast operator between opaque void* pointers on the
C++ side and capsules on the Python side. The py::cast<void *>
expression was not aware of this possibility and incorrectly triggered a
compile-time assertion ("Unable to cast type to reference: value is
local to type caster") that is now fixed.
2018-11-11 19:32:09 +01:00
Wenzel Jakob
e2eca4f8f8
Support C++17 aligned new statement (#1582)
* Support C++17 aligned new statement

This patch makes pybind11 aware of nonstandard alignment requirements in
bound types and passes on this information to C++17 aligned 'new'
operator. Pre-C++17, the behavior is unchanged.
2018-11-09 20:14:53 +01:00
Wenzel Jakob
adc2cdd5c4
fixed regression in STL type caster RVPs (fixes #1561) (#1603) 2018-11-09 20:12:46 +01:00
Wenzel Jakob
9f73060cc7
std::array<> caster: support arbitrary sequences (#1602)
This PR brings the std::array<> caster in sync with the other STL type
casters: to accept an arbitrary sequence as input (rather than a list,
which is too restrictive).
2018-11-09 12:32:48 +01:00
Michał Wawrzyniec Urbańczyk
978d439e92 Add PYBIND11_ prefix to the THROW macro to prevent name collisions. (#1578) 2018-11-03 13:20:08 +01:00
Josh Kelley
741576dd11 Update documentation for initialize_interpreter (#1584)
Add a detailed link to Python 3 documentation.  Add a caveat about
the program terminating if initializing the interpreter fails.
2018-11-01 02:10:11 +01:00
Rune Paamand
06d021b6e4 Issue #1532: Incompatible config options, /MP vs /Gm for MSVC in DEBUG (#1533)
* Issue #1532: Incompatible config options, /MP vs /Gm for MSVC in DEBUG
2018-10-25 01:35:33 +02:00
Wenzel Jakob
c9b8933e9a flake8 fix 2018-10-24 13:25:25 +02:00
Tarcísio Fischer
54eb8193e5 Fix scoped enums comparison for equal/not equal cases (#1339) (#1571) 2018-10-24 11:18:58 +02:00
Ryota Suzuki
1377fbf73c Fix unintentional escaping of character on Windows (#1574) (#1575) 2018-10-24 11:18:04 +02:00
cdyson37
111b25b260 Mention flake8 and check-style.sh in CONTRIBUTING (#1567) 2018-10-14 20:14:04 +02:00
Allan Leal
e76dff7751 Fix for Issue #1258 (#1298)
* Fix for Issue #1258

list_caster::load method will now check for a Python string and prevent its automatic conversion to a list.
This should fix the issue "pybind11/stl.h converts string to vector<string> #1258" (https://github.com/pybind/pybind11/issues/1258)

* Added tests for fix of issue #1258

* Changelog: stl string auto-conversion
2018-10-11 10:28:12 +02:00
Henry Schreiner
0f404a5d4d Allow recursive checkout without https (#1563) 2018-10-10 21:28:53 +02:00
Jason Rhinelander
177713fa4e Fix gcc-8 compilation warning 2018-10-02 12:11:37 -03:00
Rune Paamand
73634b6db7 Update iostream.h: Changed a local varname 'self' to 'self_' (#1535)
* Update iostream.h: Changed a local varname 'self' to 'self_'

Avoiding conflicts in namespace pybind11::self.
https://github.com/pybind/pybind11/issues/1531
2018-09-27 16:26:42 +02:00