예제 #1
0
 def wrapped(backend, *args, **kwargs):
     try:
         sig = inspect.signature(f)
     except AttributeError:
         spec = inspect.getargspec(f)
         params = spec[0]
     else:
         params = sig.parameters
     if 'backend' in params:
         kwargs.setdefault('backend', backend)
     with substituted_trueskill(backend=backend):
         return f(*args, **kwargs)
예제 #2
0
 def wrapped(backend, *args, **kwargs):
     try:
         sig = inspect.signature(f)
     except AttributeError:
         spec = inspect.getargspec(f)
         params = spec[0]
     else:
         params = sig.parameters
     if 'backend' in params:
         kwargs.setdefault('backend', backend)
     with substituted_trueskill(backend=backend):
         return f(*args, **kwargs)
예제 #3
0
 def wrapped(backend, *args, **kwargs):
     if 'backend' in inspect.getargspec(f)[0]:
         kwargs['backend'] = kwargs.get('backend', backend)
     with substituted_trueskill(backend=backend):
         return f(*args, **kwargs)
 def wrapped(backend, *args, **kwargs):
     if 'backend' in inspect.getargspec(f)[0]:
         kwargs['backend'] = kwargs.get('backend', backend)
     with substituted_trueskill(backend=backend):
         return f(*args, **kwargs)