Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit c2e76b0

Browse files
committed
Fix bug: Namespace switch prevents LT from returning eval result if source file contains errors.
1 parent c53d564 commit c2e76b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

py-src/ltipy.py

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def noop():
1717
requests = {}
1818
connected = noop
1919
disconnected = noop
20+
curNs = None
2021

2122
def km_from_string(s=''):
2223
"""create kernel manager from IPKernelApp string
@@ -183,7 +184,10 @@ def initIPy(s):
183184
disconnected()
184185

185186
def setNs(path):
187+
if path==curNs: return
186188
send("import lttools\nlttools.switch_ns('" + path.replace('\\', '\\\\') + "')")
189+
time.sleep(0.1) #wait for msgloop to clear this namespace switch
190+
path = curNs
187191

188192
def IPyOutput(l):
189193
m = re.search('--existing (.*\.json)', l)

0 commit comments

Comments
 (0)