Skip to content

Commit

Permalink
localized_function(): don't validate absent param (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanceNCounter authored Apr 11, 2021
1 parent eee9570 commit 461004b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lingua_franca/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,19 @@ def nice_number(number, lang='', speech=True, denominators=None):
"received this value:\n" + str(run_own_code_on))
# TODO deprecate these kwarg values 6-12 months after v0.3.0 releases

def is_error_type(_type):
if not callable(_type):
return False
_instance = _type()
rval = isinstance(_instance, BaseException) if _instance else True
del _instance
return rval
if not isinstance(run_own_code_on, list):
try:
run_own_code_on = list(run_own_code_on)
except TypeError:
raise BadTypeError
if run_own_code_on != [None]:
def is_error_type(_type):
if not callable(_type):
return False
_instance = _type()
rval = isinstance(_instance, BaseException) if _instance else True
del _instance
return rval
if not isinstance(run_own_code_on, list):
try:
run_own_code_on = list(run_own_code_on)
except TypeError:
raise BadTypeError
if not all((is_error_type(e) for e in run_own_code_on)):
raise BadTypeError

Expand Down

0 comments on commit 461004b

Please sign in to comment.