Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mathics/format/form/outputform.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ def render_output_form(expr: BaseElement, evaluation: Evaluation, **kwargs):
callback = _default_render_output_form
try:
result = callback(format_expr, evaluation, **kwargs)
return result
except _WrongFormattedExpression:
except Exception:
# If the key is not present, or the execution fails for any reason, use
# the default
pass
return _default_render_output_form(format_expr, evaluation, **kwargs)
return _default_render_output_form(format_expr, evaluation, **kwargs)
else:
return result


@register_outputform("System`Format")
Expand Down
7 changes: 7 additions & 0 deletions test/builtin/string/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
"StringTake[]",
"StringTake argument checking",
),
(
'xx = "a string"; StringTake[xx[0]]',
("StringTake called with 1 argument; 2 arguments are expected.",),
"StringTake[a string[0]]",
"StringTake bug in formatting",
),
("Clear[xx]", None, None, None),
],
)
def test_string_take(str_expr, msgs, str_expected, fail_msg):
Expand Down
Loading