8000 Fix bug in SciJava script writer access · scijava/scyjava@5f5a957 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5f5a957

Browse files
committed
Fix bug in SciJava script writer access
1 parent 4ef3781 commit 5f5a957

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/scyjava/_script.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ def write(self, s):
4747
self._writer().write(s)
4848

4949
def _writer(self):
50-
return self._thread_to_context.get(
51-
threading.currentThread(), self._std_default
52-
)
50+
ctx = self._thread_to_context.get(threading.currentThread())
51+
return self._std_default if ctx is None else ctx.getWriter()
5352

5453
stdoutContextWriter = ScriptContextWriter(sys.stdout)
5554

0 commit comments

Comments
 (0)
0