mirror of
https://github.com/samba-team/samba.git
synced 2025-01-05 09:18:06 +03:00
python: Port simple libpython module to Python 3 compatible form
Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
aa74d6edf5
commit
ba4cabb74f
@ -18,13 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
#include "py3compat.h"
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "python/modules.h"
|
#include "python/modules.h"
|
||||||
#include "dynconfig/dynconfig.h"
|
#include "dynconfig/dynconfig.h"
|
||||||
|
|
||||||
static bool PySys_PathPrepend(PyObject *list, const char *path)
|
static bool PySys_PathPrepend(PyObject *list, const char *path)
|
||||||
{
|
{
|
||||||
PyObject *py_path = PyString_FromString(path);
|
PyObject *py_path = PyStr_FromString(path);
|
||||||
if (py_path == NULL)
|
if (py_path == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -51,17 +51,10 @@ def build(bld):
|
|||||||
pyembed=True,
|
pyembed=True,
|
||||||
enabled=bld.PYTHON_BUILD_IS_ENABLED())
|
enabled=bld.PYTHON_BUILD_IS_ENABLED())
|
||||||
|
|
||||||
bld.SAMBA_SUBSYSTEM('LIBPYTHON',
|
|
||||||
source='modules.c',
|
|
||||||
public_deps='',
|
|
||||||
init_function_sentinel='{NULL,NULL}',
|
|
||||||
deps='talloc',
|
|
||||||
pyext=True,
|
|
||||||
enabled=bld.PYTHON_BUILD_IS_ENABLED())
|
|
||||||
|
|
||||||
for env in bld.gen_python_environments():
|
for env in bld.gen_python_environments():
|
||||||
pytalloc_util = bld.pyembed_libname('pytalloc-util')
|
pytalloc_util = bld.pyembed_libname('pytalloc-util')
|
||||||
pyparam_util = bld.pyembed_libname('pyparam_util')
|
pyparam_util = bld.pyembed_libname('pyparam_util')
|
||||||
|
libpython = bld.pyembed_libname('LIBPYTHON')
|
||||||
|
|
||||||
bld.SAMBA_PYTHON('python_glue',
|
bld.SAMBA_PYTHON('python_glue',
|
||||||
source='pyglue.c',
|
source='pyglue.c',
|
||||||
@ -73,6 +66,14 @@ def build(bld):
|
|||||||
''' % (pyparam_util, pytalloc_util),
|
''' % (pyparam_util, pytalloc_util),
|
||||||
realname='samba/_glue.so')
|
realname='samba/_glue.so')
|
||||||
|
|
||||||
|
bld.SAMBA_SUBSYSTEM(libpython,
|
||||||
|
source='modules.c',
|
||||||
|
public_deps='',
|
||||||
|
init_function_sentinel='{NULL,NULL}',
|
||||||
|
deps='talloc',
|
||||||
|
pyext=True,
|
||||||
|
enabled=bld.PYTHON_BUILD_IS_ENABLED())
|
||||||
|
|
||||||
if bld.PYTHON_BUILD_IS_ENABLED():
|
if bld.PYTHON_BUILD_IS_ENABLED():
|
||||||
for env in bld.gen_python_environments():
|
for env in bld.gen_python_environments():
|
||||||
# install out various python scripts for use by make test
|
# install out various python scripts for use by make test
|
||||||
|
Loading…
Reference in New Issue
Block a user