Skip to content

Commit

Permalink
Add _ldap.__version__
Browse files Browse the repository at this point in the history
Cherry-picked from: b837b54 stripped trailing spaces from C source files
  • Loading branch information
Petr Viktorin committed Nov 22, 2017
1 parent 1721df1 commit aedfdd1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Modules/ldapmodule.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
/* See https://www.python-ldap.org/ for details. */

#include "common.h"
#include "version.h"
#include "constants.h"
#include "errors.h"
#include "functions.h"
#include "ldapcontrol.h"

#include "LDAPObject.h"

#define _STR(x) #x
#define STR(x) _STR(x)

static char version_str[] = STR(LDAPMODULE_VERSION);

void
LDAPinit_version( PyObject* d )
{
PyObject *version;

version = PyString_FromString(version_str);
PyDict_SetItemString( d, "__version__", version );
Py_DECREF(version);
}

DL_EXPORT(void) init_ldap(void);

/* dummy module methods */
Expand Down

0 comments on commit aedfdd1

Please sign in to comment.