swig/swig307-Python35-fix-builtin.patch

29 lines
1.1 KiB
Diff
Raw Normal View History

From ef001de5240c1e05494e23b933b687f3f266045c Mon Sep 17 00:00:00 2001
From: William S Fulton <wsf@fultondesigns.co.uk>
Date: Sat, 10 Oct 2015 00:38:52 +0100
Subject: [PATCH] Support Python 3.5 and -builtin.
PyAsyncMethods is a new member in PyHeapTypeObject.
Closes#539
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx
index 7bc5658..3395ebe 100644
--- a/Source/Modules/python.cxx
+++ b/Source/Modules/python.cxx
@@ -4053,6 +4053,15 @@ class PYTHON:public Language {
Printv(f, "#endif\n", NIL);
Printf(f, " },\n");
+ // PyAsyncMethods as_async
+ Printv(f, "#if PY_VERSION_HEX >= 0x03050000\n", NIL);
+ Printf(f, " {\n");
+ printSlot(f, getSlot(n, "feature:python:am_await"), "am_await", "unaryfunc");
+ printSlot(f, getSlot(n, "feature:python:am_aiter"), "am_aiter", "unaryfunc");
+ printSlot(f, getSlot(n, "feature:python:am_anext"), "am_anext", "unaryfunc");
+ Printf(f, " },\n");
+ Printv(f, "#endif\n", NIL);
+
// PyNumberMethods as_number
Printf(f, " {\n");
printSlot(f, getSlot(n, "feature:python:nb_add"), "nb_add", "binaryfunc");