Skip to content

Commit

Permalink
fixed nargin
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlei committed Aug 16, 2016
1 parent f61f49d commit 1cf07b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions smop/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ def _backend(self,level=0):

s = """
@function
def {0}({1}{2}nargin=-1):
def {0}({1}):
nargin = sys._getframe(1).f_locals["nargin"]
""".format(self.ident._backend(),
self.args._backend(),
"," if self.args else "")
self.args._backend())

return s

Expand Down
6 changes: 3 additions & 3 deletions smop/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,9 @@ def print_usage():
raise Exception

def function(f):
def helper(*args,**kwargs):
kwargs["nargin"]=len(args)
return f(*args,**kwargs)
def helper(*args):
nargin=len(args)
return f(*args)
return helper

def error(s):
Expand Down

0 comments on commit 1cf07b9

Please sign in to comment.