Skip to content

Commit bf59c8d

Browse files
committed
Inlined handle_argument which was only used once.
Thanks @stasm
1 parent 06f2a1e commit bf59c8d

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

fluent.runtime/fluent/bundle/resolver.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,14 @@ def handle_variable_reference(argument, env):
207207
FluentReferenceError("Unknown external: {0}".format(name)))
208208
return FluentNone(name)
209209

210-
return handle_argument(arg_val, name, env)
210+
if isinstance(arg_val,
211+
(int, float, Decimal,
212+
date, datetime,
213+
text_type)):
214+
return arg_val
215+
env.errors.append(TypeError("Unsupported external type: {0}, {1}"
216+
.format(name, type(arg_val))))
217+
return FluentNone(name)
211218

212219

213220
@handle.register(AttributeExpression)
@@ -378,14 +385,3 @@ def handle_date(d, env):
378385
@handle.register(datetime)
379386
def handle_datetime(d, env):
380387
return fluent_date(d).format(env.context._babel_locale)
381-
382-
383-
def handle_argument(arg, name, env):
384-
if isinstance(arg,
385-
(int, float, Decimal,
386-
date, datetime,
387-
text_type)):
388-
return arg
389-
env.errors.append(TypeError("Unsupported external type: {0}, {1}"
390-
.format(name, type(arg))))
391-
return FluentNone(name)

0 commit comments

Comments
 (0)