Params is a list or tuple
This commit is contained in:
parent
aa21245a19
commit
c726405601
|
@ -25,7 +25,7 @@ class Params:
|
||||||
if isinstance(args, Param):
|
if isinstance(args, Param):
|
||||||
args = (args,)
|
args = (args,)
|
||||||
else:
|
else:
|
||||||
if not isinstance(args, list):
|
if not isinstance(args, (tuple, list)):
|
||||||
raise ValueError(_('args in params must be a list'))
|
raise ValueError(_('args in params must be a list'))
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if not isinstance(arg, Param):
|
if not isinstance(arg, Param):
|
||||||
|
@ -35,6 +35,8 @@ class Params:
|
||||||
for arg in kwargs.values():
|
for arg in kwargs.values():
|
||||||
if not isinstance(arg, Param):
|
if not isinstance(arg, Param):
|
||||||
raise ValueError(_('arg in params must be a Param'))
|
raise ValueError(_('arg in params must be a Param'))
|
||||||
|
if isinstance(args, list):
|
||||||
|
args = tuple(args)
|
||||||
self.args = args
|
self.args = args
|
||||||
self.kwargs = kwargs
|
self.kwargs = kwargs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue