as_range: Catch TypeErrors
This commit is contained in:
@@ -213,6 +213,10 @@ def as_range(n):
|
|||||||
"""
|
"""
|
||||||
Return a range of n items.
|
Return a range of n items.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
|
int(n)
|
||||||
|
except TypeError:
|
||||||
|
return list()
|
||||||
return range(n)
|
return range(n)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user