Skip to content

Commit 631a99b

Browse files
authored
Fix deprecation on GetPythonHome (#652)
1 parent 662e644 commit 631a99b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/xutils.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ namespace xpyt
109109
{
110110
std::setlocale(LC_ALL, "en_US.utf8");
111111
// Py_GetPythonHome will return NULL if called before Py_Initialize()
112-
wchar_t* ph = Py_GetPythonHome();
112+
PyConfig config;
113+
PyConfig_InitPythonConfig(&config);
114+
wchar_t* ph = config.home;
113115

114116
if (ph)
115117
{

0 commit comments

Comments
 (0)