summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2015-05-25 17:44:01 +0200
committerStefan Behnel <stefan_ml@behnel.de>2015-05-25 17:44:01 +0200
commita129d192ed1588e1f0fc8c041f5b56e1ccae0768 (patch)
treee11018b0a1939c6f7aaf79196084f246b88710bb /Cython/Compiler/ModuleNode.py
parent19ffc8b6d4279f4b0d495b9c8320bd2f2533b874 (diff)
parent9ee3d69afb373fede3f116dbad0821f074bdc25c (diff)
downloadcython-a129d192ed1588e1f0fc8c041f5b56e1ccae0768.tar.gz
Merge branch '_pep492_async_await'
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 07bbd2289..a96fc90ad 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2071,17 +2071,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("%s = PyBytes_FromStringAndSize(\"\", 0); %s" % (
Naming.empty_bytes, code.error_goto_if_null(Naming.empty_bytes, self.pos)))
- code.putln("#ifdef __Pyx_CyFunction_USED")
- code.put_error_if_neg(self.pos, "__Pyx_CyFunction_init()")
- code.putln("#endif")
-
- code.putln("#ifdef __Pyx_FusedFunction_USED")
- code.put_error_if_neg(self.pos, "__pyx_FusedFunction_init()")
- code.putln("#endif")
-
- code.putln("#ifdef __Pyx_Generator_USED")
- code.put_error_if_neg(self.pos, "__pyx_Generator_init()")
- code.putln("#endif")
+ for ext_type in ('CyFunction', 'FusedFunction', 'Coroutine', 'Generator', 'StopAsyncIteration'):
+ code.putln("#ifdef __Pyx_%s_USED" % ext_type)
+ code.put_error_if_neg(self.pos, "__pyx_%s_init()" % ext_type)
+ code.putln("#endif")
code.putln("/*--- Library function declarations ---*/")
env.generate_library_function_declarations(code)