Skip to content

Commit 12a0dea

Browse files
committed
sys implementation is python3 only
1 parent 3299945 commit 12a0dea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

PythonInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ static std::string __getPythonInfoJSON()
1818
nlohmann::json topObj;
1919
auto& pythonInfo = topObj["Python Info"];
2020
pythonInfo["Exec Prefix"] = sys.get<std::string>("exec_prefix");
21+
#if PY_MAJOR_VERSION >= 3
2122
pythonInfo["Implementation"] = sys.get("implementation").get<std::string>("name");
2223
pythonInfo["Cache Tag"] = sys.get("implementation").get<std::string>("cache_tag");
24+
#endif
2325

2426
auto& versionInfo = pythonInfo["Version Info"];
2527

0 commit comments

Comments
 (0)