summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/pyluatex/pyluatex-interpreter.py
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/latex/pyluatex/pyluatex-interpreter.py')
-rw-r--r--macros/luatex/latex/pyluatex/pyluatex-interpreter.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/macros/luatex/latex/pyluatex/pyluatex-interpreter.py b/macros/luatex/latex/pyluatex/pyluatex-interpreter.py
index 0e8b32035f..4d713e7ab3 100644
--- a/macros/luatex/latex/pyluatex/pyluatex-interpreter.py
+++ b/macros/luatex/latex/pyluatex/pyluatex-interpreter.py
@@ -1,7 +1,7 @@
"""
MIT License
-Copyright (c) 2021 Tobias Enderle
+Copyright (c) 2021-2022 Tobias Enderle
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -84,10 +84,13 @@ class Handler(socketserver.StreamRequestHandler):
interpreters = defaultdict(Interpreter)
while True:
data = self.rfile.readline().decode('utf-8')
- if len(data) == 0:
+ if len(data) == 0: # socket closed, LuaTeX process finished
return
data = json.loads(data)
+ if data == 'shutdown':
+ return
+
interpreter = interpreters[data['session']]
code = textwrap.dedent(data['code'])
if data['repl_mode']: