Skip to content

Commit abf1edc

Browse files
committed
Some small changes
1 parent 2dd4f22 commit abf1edc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mathicsscript/format.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def format_output(obj, expr, format=None):
2727
leaves = expr.get_leaves()
2828
if len(leaves) == 1:
2929
expr = leaves[0]
30-
elif expr_type == "System`Graphics":
30+
elif expr_type in ("System`Graphics", "System`Plot"):
3131
result = "-System Graphics-"
3232
# result = Expression("StandardForm", expr).format(obj, "System`MathMLForm")
3333
# ml_str = result.leaves[0].leaves[0]
@@ -41,7 +41,7 @@ def format_output(obj, expr, format=None):
4141
elif format == "tex":
4242
result = Expression("StandardForm", expr).format(obj, "System`TeXForm")
4343
elif format == "unformatted":
44-
if str(expr) == "-Graph-":
44+
if str(expr) == "-Graph-" and hasattr(expr, "G"):
4545
return format_graph(expr.G)
4646
else:
4747
result = expr.format(obj, "System`OutputForm")

mathicsscript/termshell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def complete_symbol_name(self, text, state):
276276
)
277277
return self._complete_symbol_name(text, state)
278278

279-
except Exception as e:
279+
except Exception:
280280
# any exception thrown inside the completer gets silently
281281
# thrown away otherwise
282282
print("Unhandled error in readline completion")
@@ -319,7 +319,7 @@ def get_completion_candidates(self, text):
319319
suffix = text
320320
try:
321321
matches = self.definitions.get_matching_names(suffix + "*")
322-
except Exception as e:
322+
except Exception:
323323
return []
324324
if "`" not in text:
325325
matches = [strip_context(m) for m in matches]

0 commit comments

Comments
 (0)