From c50a47ed65f912a412a1091d5dbf4d9b8c6f42a6 Mon Sep 17 00:00:00 2001 From: Victor Leikehman Date: Sun, 12 Oct 2014 13:37:46 +0300 Subject: [PATCH] nargin bug fixed --- smop/backend.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/smop/backend.py b/smop/backend.py index 9931f53f..f93d236e 100644 --- a/smop/backend.py +++ b/smop/backend.py @@ -312,10 +312,11 @@ def _backend(self,level=0): s = "def %s(*args,**kwargs):\n" % self.ident._backend() else: s = "def %s(%s,*args,**kwargs):\n" % (self.ident._backend(), - self.args[:-1]._backend()) + node.expr_list(self.args[:-1])._backend()) s += ' varargin = cellarray(args)\n' - s += ' nargin = len(args)+%d\n' % (len(self.args)-1) - + #s += ' nargin = len(args)+%d\n' % (len(self.args)-1) + if self.use_nargin: + s += '\n nargin = %s.__code__.co_argcount\n' % self.ident._backend() return s """