Skip to content

Commit 7c4a8bc

Browse files
committed
Merge branch 'master' into weak_ptr_test_only
2 parents 222b4a7 + 002c05b commit 7c4a8bc

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ repos:
2525

2626
# Clang format the codebase automatically
2727
- repo: https://github.com/pre-commit/mirrors-clang-format
28-
rev: "v20.1.0"
28+
rev: "v20.1.3"
2929
hooks:
3030
- id: clang-format
3131
types_or: [c++, c, cuda]
3232

3333
# Ruff, the Python auto-correcting linter/formatter written in Rust
3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: v0.11.4
35+
rev: v0.11.8
3636
hooks:
3737
- id: ruff
3838
args: ["--fix", "--show-fixes"]
@@ -144,14 +144,14 @@ repos:
144144

145145
# PyLint has native support - not always usable, but works for us
146146
- repo: https://github.com/PyCQA/pylint
147-
rev: "v3.3.6"
147+
rev: "v3.3.7"
148148
hooks:
149149
- id: pylint
150150
files: ^pybind11
151151

152152
# Check schemas on some of our YAML files
153153
- repo: https://github.com/python-jsonschema/check-jsonschema
154-
rev: 0.32.1
154+
rev: 0.33.0
155155
hooks:
156156
- id: check-readthedocs
157157
- id: check-github-workflows

include/pybind11/conduit/wrap_include_python_h.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#endif
5151

5252
#if defined(PYBIND11_DEBUG_MARKER)
53-
# define _DEBUG
53+
# define _DEBUG 1
5454
# undef PYBIND11_DEBUG_MARKER
5555
#endif
5656

include/pybind11/detail/function_record_pyobject.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "common.h"
1414

1515
#include <cstring>
16+
#include <utility>
1617

1718
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1819
PYBIND11_NAMESPACE_BEGIN(detail)
@@ -188,9 +189,11 @@ inline PyObject *reduce_ex_impl(PyObject *self, PyObject *, PyObject *) {
188189
&& PyModule_Check(rec->scope.ptr()) != 0) {
189190
object scope_module = get_scope_module(rec->scope);
190191
if (scope_module) {
191-
return make_tuple(reinterpret_borrow<object>(PyEval_GetBuiltins())["eval"],
192-
make_tuple(str("__import__('importlib').import_module('")
193-
+ scope_module + str("')")))
192+
auto builtins = reinterpret_borrow<dict>(PyEval_GetBuiltins());
193+
auto builtins_eval = builtins["eval"];
194+
auto reconstruct_args = make_tuple(str("__import__('importlib').import_module('")
195+
+ scope_module + str("')"));
196+
return make_tuple(std::move(builtins_eval), std::move(reconstruct_args))
194197
.release()
195198
.ptr();
196199
}

0 commit comments

Comments
 (0)