FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed PythonDotNET for Python 2.6 · pythonnet/pythonnet@c7aed5c · GitHub

Commit c7aed5c

Browse files
committed
Fixed PythonDotNET for Python 2.6
PythonDotNET does *not* support several new features like the backported buffer protocol, bytearray and version tags (yet)
1 parent 36604d5 commit c7aed5c

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎pythonnet/src/runtime/interop.cs‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ public static int magic() {
156156
public static int tp_subclasses = 0;
157157
public static int tp_weaklist = 0;
158158
public static int tp_del = 0;
159+
#if (PYTHON26)
160+
public static int tp_version_tag;
161+
#endif
159162
// COUNT_ALLOCS adds some more stuff to PyTypeObject
160163
#if (Py_COUNT_ALLOCS)
161164
public static int tp_allocs = 0;
@@ -226,6 +229,10 @@ public static int magic() {
226229
public static int bf_getwritebuffer = 0;
227230
public static int bf_getsegcount = 0;
228231
public static int bf_getcharbuffer = 0;
232+
#if (PYTHON26)
233+
public static int bf_getbuffer = 0;
234+
public static int bf_releasebuffer = 0;
235+
#endif
229236

230237
public static int name = 0;
231238
public static int slots = 0;
@@ -254,8 +261,15 @@ internal class TypeFlags {
254261
#if (PYTHON25 || PYTHON26)
255262
public static int HaveIndex = (1 << 17);
256263
#endif
257-
public static int Managed = (1 << 21); // PythonNet specific?
258-
public static int Subclass = (1 << 22); // PythonNet specific?
264+
#if (PYTHON26)
265+
public static int HaveVersionTag = (1<<18);
266+
public static int ValidVersionTag = (1<<19);
267+
public static int IsAbstract = (1<<20);
268+
public static int HaveNewBuffer = (1<<21);
269+
#endif
270+
/* XXX Reusing reserved constants */
271+
public static int Managed = (1 << 15); // PythonNet specific
272+
public static int Subclass = (1 << 16); // PythonNet specific
259273
#if (PYTHON26)
260274
// TODO: Implement FastSubclass functions
261275
public static int IntSubclass = (1 << 23);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL