diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2015-05-25 17:44:01 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2015-05-25 17:44:01 +0200 |
commit | a129d192ed1588e1f0fc8c041f5b56e1ccae0768 (patch) | |
tree | e11018b0a1939c6f7aaf79196084f246b88710bb /Cython/Compiler/ModuleNode.py | |
parent | 19ffc8b6d4279f4b0d495b9c8320bd2f2533b874 (diff) | |
parent | 9ee3d69afb373fede3f116dbad0821f074bdc25c (diff) | |
download | cython-a129d192ed1588e1f0fc8c041f5b56e1ccae0768.tar.gz |
Merge branch '_pep492_async_await'
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 15 |
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) |