Skip to content

Commit

Permalink
fix python3 code for new context model
Browse files Browse the repository at this point in the history
  • Loading branch information
peadar committed Dec 18, 2024
1 parent e3bbd45 commit 0c83082
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,21 @@ getInterpHead<3>(Procman::Process &proc) {

std::tie(libpython, libpythonAddr, _PyRuntimeSym) = proc.resolveSymbolDetail(
"_PyRuntime", false,
[](std::string_view name) {
auto base = basename(std::string(name));
[&](std::string_view name) {
auto base = proc.context.basename(std::string(name));
return base.find("python3") != std::string::npos;
});

Elf::Addr interpHead = libpythonAddr + _PyRuntimeSym.st_value + pyInterpOffset();

if (libpython == nullptr) {
if (verbose)
*debug << "Python 3 interpreter not found" << std::endl;
if (proc.context.verbose)
*proc.context.debug << "Python 3 interpreter not found" << std::endl;
throw Exception() << "No libpython3 found";
}

if (verbose)
*debug << "python3 library is " << *libpython->io << std::endl;
if (proc.context.verbose)
*proc.context.debug << "python3 library is " << *libpython->io << std::endl;

return std::make_tuple(libpython, libpythonAddr, interpHead);
}
Expand Down

0 comments on commit 0c83082

Please sign in to comment.