mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Add modpython module which allows to write ZNC modules on python3.
Notice for distro maintainers: perl interpreter is required to compile modpython. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2196 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
16
modules/modpython/compiler.cpp
Normal file
16
modules/modpython/compiler.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2010 See the AUTHORS file for details.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published
|
||||
* by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
int main() {
|
||||
Py_Initialize();
|
||||
int res = PyRun_SimpleString("import compileall; print('Optimizing python files for later use...'); compileall.compile_dir('.')");
|
||||
Py_Finalize();
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user