Skip to content

Commit af537e7

Browse files
committed
git grep 0x03080000 cleanup.
1 parent 2324df0 commit af537e7

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

include/pybind11/cast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct type_caster<T, enable_if_t<std::is_arithmetic<T>::value && !is_std_char_t
158158
} else {
159159
handle src_or_index = src;
160160
// PyPy: 7.3.7's 3.8 does not implement PyLong_*'s __index__ calls.
161-
#if PY_VERSION_HEX < 0x03080000 || defined(PYPY_VERSION)
161+
#if defined(PYPY_VERSION)
162162
object index;
163163
if (!PYBIND11_LONG_CHECK(src.ptr())) { // So: index_check(src.ptr())
164164
index = reinterpret_steal<object>(PyNumber_Index(src.ptr()));

include/pybind11/detail/class.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -466,19 +466,9 @@ extern "C" inline void pybind11_object_dealloc(PyObject *self) {
466466

467467
type->tp_free(self);
468468

469-
#if PY_VERSION_HEX < 0x03080000
470-
// `type->tp_dealloc != pybind11_object_dealloc` means that we're being called
471-
// as part of a derived type's dealloc, in which case we're not allowed to decref
472-
// the type here. For cross-module compatibility, we shouldn't compare directly
473-
// with `pybind11_object_dealloc`, but with the common one stashed in internals.
474-
auto pybind11_object_type = (PyTypeObject *) get_internals().instance_base;
475-
if (type->tp_dealloc == pybind11_object_type->tp_dealloc)
476-
Py_DECREF(type);
477-
#else
478469
// This was not needed before Python 3.8 (Python issue 35810)
479470
// https://github.com/pybind/pybind11/issues/1946
480471
Py_DECREF(type);
481-
#endif
482472
}
483473

484474
std::string error_string();

include/pybind11/detail/internals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ inline void translate_local_exception(std::exception_ptr p) {
436436

437437
inline object get_python_state_dict() {
438438
object state_dict;
439-
#if PYBIND11_INTERNALS_VERSION <= 4 || PY_VERSION_HEX < 0x03080000 || defined(PYPY_VERSION)
439+
#if PYBIND11_INTERNALS_VERSION <= 4 || defined(PYPY_VERSION)
440440
state_dict = reinterpret_borrow<object>(PyEval_GetBuiltins());
441441
#else
442442
# if PY_VERSION_HEX < 0x03090000

include/pybind11/eval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1919
PYBIND11_NAMESPACE_BEGIN(detail)
2020

2121
inline void ensure_builtins_in_globals(object &global) {
22-
#if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x03080000
22+
#if defined(PYPY_VERSION)
2323
// Running exec and eval adds `builtins` module under `__builtins__` key to
2424
// globals if not yet present. Python 3.8 made PyRun_String behave
2525
// similarly. Let's also do that for older versions, for consistency. This

0 commit comments

Comments
 (0)