Skip to content

Commit

Permalink
Fix bug in SciJava script writer access
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrueden committed May 8, 2024
1 parent 4ef3781 commit 5f5a957
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/scyjava/_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ def write(self, s):
self._writer().write(s)

def _writer(self):
return self._thread_to_context.get(
threading.currentThread(), self._std_default
)
ctx = self._thread_to_context.get(threading.currentThread())
return self._std_default if ctx is None else ctx.getWriter()

stdoutContextWriter = ScriptContextWriter(sys.stdout)

Expand Down

0 comments on commit 5f5a957

Please sign in to comment.