Skip to content

Commit

Permalink
fix: missing move in eval.h (#3775)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylion007 authored Mar 2, 2022
1 parent af08a95 commit 2dd5254
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/pybind11/eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ template <eval_mode mode = eval_expr, size_t N>
object eval(const char (&s)[N], object global = globals(), object local = object()) {
/* Support raw string literals by removing common leading whitespace */
auto expr = (s[0] == '\n') ? str(module_::import("textwrap").attr("dedent")(s)) : str(s);
return eval<mode>(expr, global, local);
return eval<mode>(expr, std::move(global), std::move(local));
}

inline void exec(const str &expr, object global = globals(), object local = object()) {
Expand All @@ -91,7 +91,7 @@ inline void exec(const str &expr, object global = globals(), object local = obje

template <size_t N>
void exec(const char (&s)[N], object global = globals(), object local = object()) {
eval<eval_statements>(s, global, local);
eval<eval_statements>(s, std::move(global), std::move(local));
}

#if defined(PYPY_VERSION)
Expand Down

0 comments on commit 2dd5254

Please sign in to comment.