mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix modpython to work with python 3.2
Thanks to nb for reporting and testing git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2214 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -8,9 +8,17 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
int main() {
|
||||
int main(int argc, char** argv) {
|
||||
Py_Initialize();
|
||||
int res = PyRun_SimpleString("import compileall; print('Optimizing python files for later use...'); compileall.compile_dir('.')");
|
||||
int res = PyRun_SimpleString(
|
||||
"import compileall\n"
|
||||
"print('Optimizing python files for later use...')\n"
|
||||
"import sys\n"
|
||||
"if sys.version_info < (3, 2):\n"
|
||||
" compileall.compile_dir('.')\n"
|
||||
"else:\n"
|
||||
" compileall.compile_dir('.', legacy=True)\n"
|
||||
);
|
||||
Py_Finalize();
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user