Skip to content

Commit 1002ce2

Browse files
committed
Fix live environment
1 parent 4ab7bd6 commit 1002ce2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ def getvar(self, name: str, **kwargs) -> XTDatastore:
6868
return XTDatastore(self.memory, name, **kwargs)
6969

7070
def execute(self, line: str, raise_error: bool = False) -> Any:
71+
if self._live and ((self.linetrk and self.linetrk[-1][0] != "<stdin>") or not self.linetrk):
72+
self.linetrk.append(["<stdin>", "<stdin>.global", 0, False, "<stdin>"])
73+
7174
try:
7275
tokens = self.parseline(line)
7376
try:
@@ -250,6 +253,7 @@ def run_section(self, section: str) -> Any:
250253
print(f"{__version__} Copyright (c) 2022 iiPython")
251254
inter._live, linedata = True, ""
252255
inter.load_sections(":global\n", "<stdin>")
256+
inter.memory.vars["local"]["<stdin>.global"] = {}
253257
while True:
254258
try:
255259
line = input(f"{'>' if not linedata else ':'} ")

0 commit comments

Comments
 (0)