mirror of
https://github.com/samba-team/samba.git
synced 2025-02-25 17:57:42 +03:00
pytdb: Add __version__ attribute.
This commit is contained in:
parent
8cec67fe61
commit
6cd722d950
@ -592,6 +592,8 @@ void inittdb(void)
|
||||
|
||||
PyModule_AddObject(m, "__docformat__", PyString_FromString("restructuredText"));
|
||||
|
||||
PyModule_AddObject(m, "__version__", PyString_FromString(PACKAGE_VERSION));
|
||||
|
||||
Py_INCREF(&PyTdb);
|
||||
PyModule_AddObject(m, "Tdb", (PyObject *)&PyTdb);
|
||||
|
||||
|
@ -165,6 +165,12 @@ class SimpleTdbTests(TestCase):
|
||||
self.tdb.remove_flags(tdb.NOMMAP)
|
||||
|
||||
|
||||
class VersionTests(TestCase):
|
||||
|
||||
def test_present(self):
|
||||
self.assertTrue(isinstance(tdb.__version__, str))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import unittest
|
||||
unittest.TestProgram()
|
||||
|
@ -98,7 +98,8 @@ def build(bld):
|
||||
'pytdb.c',
|
||||
deps='tdb',
|
||||
enabled=not bld.env.disable_python,
|
||||
realname='tdb.so')
|
||||
realname='tdb.so',
|
||||
cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
|
||||
|
||||
if bld.env.standalone_tdb:
|
||||
bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
|
||||
|
Loading…
x
Reference in New Issue
Block a user