release: 0.2.2

This commit is contained in:
Romain Dorgueil
2017-04-28 08:04:48 +02:00
parent 9a3fa98723
commit bb5fc22f5e
21 changed files with 56 additions and 63 deletions

View File

@ -32,7 +32,8 @@ def deprecated_alias(alias, func):
warnings.simplefilter('always', DeprecationWarning) # turn off filter
warnings.warn(
"Call to deprecated function alias {}, use {} instead.".format(alias, func.__name__),
category=DeprecationWarning, stacklevel=2
category=DeprecationWarning,
stacklevel=2
)
warnings.simplefilter('default', DeprecationWarning) # reset filter
return func(*args, **kwargs)

View File

@ -20,10 +20,10 @@ def force_iterator(mixed):
def ensure_tuple(tuple_or_mixed):
if isinstance(tuple_or_mixed, tuple):
return tuple_or_mixed
return (tuple_or_mixed,)
return (tuple_or_mixed, )
def iter_if_not_sequence(mixed):
if isinstance(mixed, (dict, list, str)):
raise TypeError(type(mixed).__name__)
return iter(mixed)
return iter(mixed)