Skip to content

Commit f4b6f02

Browse files
committed
- replace deprecated python flags with corresponding PyConfig parameters
- make method const
1 parent 05dd3a2 commit f4b6f02

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

.github/workflows/CI_build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ jobs:
4848
Rename-Item -Path ".\buildPaths.bat.orig" -NewName "buildPaths.bat"
4949
$env:WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.11\bin"
5050
$env:PATH = $env:PATH + ';' + $env:WIX_PATH
51-
$env:PATH
5251
.\buildAll.bat ${{ matrix.build_platform }}

PythonScript/src/PythonHandler.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ void PythonHandler::initPython()
9494
PyConfig config;
9595
PyConfig_InitPythonConfig(&config);
9696

97+
// Don't import site - if Python 2.7 doesn't find it as part of Py_Initialize,
98+
// it does an exit(1) - AGH!
99+
// unclear if this is still the case with python 3.12
100+
config.site_import = 0;
101+
config.use_environment = 0;
102+
config.user_site_directory = 0;
103+
104+
#ifdef _DEBUG
105+
config.verbose = 1;
106+
#endif
107+
97108
// Read all configuration at once
98109
// implicit pre config python
99110
status = PyConfig_Read(&config);
@@ -102,16 +113,6 @@ void PythonHandler::initPython()
102113
PyConfig_Clear(&config);
103114
}
104115

105-
// Don't import site - if Python 2.7 doesn't find it as part of Py_Initialize,
106-
// it does an exit(1) - AGH!
107-
Py_NoSiteFlag = 1;
108-
Py_IgnoreEnvironmentFlag = 1;
109-
Py_NoUserSiteDirectory = 1;
110-
111-
#ifdef _DEBUG
112-
Py_VerboseFlag = 1;
113-
#endif
114-
115116
bool configSetFailed = false;
116117

117118
//appended or prepended below in this order
@@ -257,8 +258,8 @@ void PythonHandler::initSysArgv()
257258
argvList.append(boost::python::handle<>(unicodeArg));
258259
}
259260

260-
boost::python::object sysModule(boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("sys"))));
261-
sysModule.attr("argv") = argvList;
261+
//boost::python::object sysModule(boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("sys"))));
262+
//sysModule.attr("argv") = argvList;
262263

263264

264265
}

PythonScript/src/ScintillaCallback.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
namespace NppPythonScript
55
{
66

7-
class ScintillaCallback
7+
class ScintillaCallback
88
{
99
public:
10-
ScintillaCallback(boost::python::object callback, bool isAsync)
10+
ScintillaCallback(boost::python::object callback, bool isAsync)
1111
: m_callback(callback),
12-
m_isAsync(isAsync)
12+
m_isAsync(isAsync)
1313
{}
1414

1515

1616
boost::python::object getCallback() { return m_callback; }
17-
bool isAsync() { return m_isAsync; }
17+
bool isAsync() const { return m_isAsync; }
1818

1919
private:
2020
boost::python::object m_callback;
21-
bool m_isAsync;
21+
bool m_isAsync;
2222
};
2323
}
2424

25-
#endif // SCINTILLACALLBACK_20140303_H
25+
#endif // SCINTILLACALLBACK_20140303_H

0 commit comments

Comments
 (0)