From 5a2b441ad6f5fc971a5543cd3ecf4c64c6600d4c Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 28 Dec 2008 16:53:54 +0100 Subject: [PATCH] avoid minor redundancy in generated code --- Cython/Compiler/Nodes.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 573ff938..84b16f18 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2021,10 +2021,11 @@ class DefNode(FuncDefNode): elif min_positional_args == max_positional_args: # parse the exact number of positional arguments from the # args tuple - code.putln('} else {') - for i, arg in enumerate(positional_args): - item = "PyTuple_GET_ITEM(%s, %d)" % (Naming.args_cname, i) - self.generate_arg_assignment(arg, item, code) + if max_positional_args > 0: + code.putln('} else {') + for i, arg in enumerate(positional_args): + item = "PyTuple_GET_ITEM(%s, %d)" % (Naming.args_cname, i) + self.generate_arg_assignment(arg, item, code) else: # parse the positional arguments from the variable length -- 2.26.2