Skip to content

Commit b6d8a7e

Browse files
author
stroeder
committed
assume C extension API for Python 2.7+
1 parent c81418e commit b6d8a7e

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Modules/
99
* removed obsolete back-ward compability constants from common.h
1010
* build checks whether LDAP_API_VERSION is OpenLDAP 2.4.x
1111
* _ldap.__author__ and _ldap.__license__ also set from ldap.pkginfo
12+
* assume C extension API for Python 2.7+
1213

1314
Lib/
1415
* removed all dependencies on modules string and types

Modules/LDAPObject.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,11 +1402,10 @@ setattr(LDAPObject* self, char* name, PyObject* value)
14021402
PyTypeObject LDAP_Type = {
14031403
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
14041404
/* see http://www.python.org/doc/FAQ.html#3.24 */
1405-
PyObject_HEAD_INIT(NULL)
1405+
PyVarObject_HEAD_INIT(NULL, 0)
14061406
#else /* ! MS_WINDOWS */
1407-
PyObject_HEAD_INIT(&PyType_Type)
1407+
PyVarObject_HEAD_INIT(&PyType_Type, 0)
14081408
#endif /* MS_WINDOWS */
1409-
0, /*ob_size*/
14101409
"LDAP", /*tp_name*/
14111410
sizeof(LDAPObject), /*tp_basicsize*/
14121411
0, /*tp_itemsize*/
@@ -1421,4 +1420,20 @@ PyTypeObject LDAP_Type = {
14211420
0, /*tp_as_sequence*/
14221421
0, /*tp_as_mapping*/
14231422
0, /*tp_hash*/
1423+
0, /*tp_call*/
1424+
0, /*tp_str*/
1425+
0, /*tp_getattro*/
1426+
0, /*tp_setattro*/
1427+
0, /*tp_as_buffer*/
1428+
0, /*tp_flags*/
1429+
0, /*tp_doc*/
1430+
0, /*tp_traverse*/
1431+
0, /*tp_clear*/
1432+
0, /*tp_richcompare*/
1433+
0, /*tp_weaklistoffset*/
1434+
0, /*tp_iter*/
1435+
0, /*tp_iternext*/
1436+
methods, /*tp_methods*/
1437+
0, /*tp_members*/
1438+
0, /*tp_getset*/
14241439
};

Modules/LDAPObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef struct {
2525
} LDAPObject;
2626

2727
extern PyTypeObject LDAP_Type;
28-
#define LDAPObject_Check(v) ((v)->ob_type == &LDAP_Type)
28+
#define LDAPObject_Check(v) (Py_TYPE(v) == &LDAP_Type)
2929

3030
extern LDAPObject *newLDAPObject( LDAP* );
3131

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy