Catch TypeError on join, and if caught just return a single item, or a list of many
This commit is contained in:
parent
7bfb689de2
commit
439a385215
1 changed files with 7 additions and 1 deletions
|
@ -420,7 +420,13 @@ class Templar:
|
||||||
if wantlist:
|
if wantlist:
|
||||||
ran = wrap_var(ran)
|
ran = wrap_var(ran)
|
||||||
else:
|
else:
|
||||||
ran = UnsafeProxy(",".join(ran))
|
try:
|
||||||
|
ran = UnsafeProxy(",".join(ran))
|
||||||
|
except TypeError:
|
||||||
|
if isinstance(ran, list) and len(ran) == 1:
|
||||||
|
ran = wrap_var(ran[0])
|
||||||
|
else:
|
||||||
|
ran = wrap_var(ran)
|
||||||
|
|
||||||
return ran
|
return ran
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue