Skip to content

Commit 7987d33

Browse files
committed
Adjust for newer API
1 parent d628461 commit 7987d33

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mathicsscript/termshell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def reset_lineno(self):
278278
def feed(self):
279279
prompt_str = self.get_in_prompt() if self.prompt else ""
280280
result = self.read_line(prompt_str) + "\n"
281-
if mathics_scanner.location.TRACK_LOCATIONS:
281+
if mathics_scanner.location.TRACK_LOCATIONS and self.source_text is not None:
282282
self.container.append(self.source_text)
283283
if result == "\n":
284284
return "" # end of input

mathicsscript/termshell_prompt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from mathics.core.symbols import SymbolNull
1717
from mathics.core.systemsymbols import SymbolMessageName
1818
from mathics_pygments.lexer import MathematicaLexer, MToken
19+
from mathics_scanner.location import ContainerKind
1920
from prompt_toolkit import HTML, PromptSession, print_formatted_text
2021
from prompt_toolkit.application.current import get_app
2122
from prompt_toolkit.enums import EditingMode
@@ -67,7 +68,7 @@ def __init__(
6768
prompt: bool,
6869
edit_mode: Optional[str],
6970
):
70-
super(TerminalShellCommon, self).__init__("<stdin>")
71+
super(TerminalShellCommon, self).__init__([], ContainerKind.STREAM)
7172
self.input_encoding = locale.getpreferredencoding()
7273
self.lineno = 0
7374
self.terminal_formatter = None

0 commit comments

Comments
 (0)