summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/prolog_session.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py
index 768f820..ee8dba3 100644
--- a/server/prolog_session.py
+++ b/server/prolog_session.py
@@ -47,10 +47,10 @@ class PrologSession(object):
if self._engine_id is not None:
prolog.engine.stop(self._engine_id)
self._engine_id = None
- reply, output = prolog.engine.create(code=code)
- if reply.get('event') != 'create':
+ engine_id, output = prolog.engine.create(code=code)
+ if not engine_id:
raise Exception('System error: could not create a prolog engine')
- self._engine_id = reply['id']
+ self._engine_id = engine_id
messages = [text for text in map(operator.itemgetter(1), output)]
status = 'error' if 'error' in map(operator.itemgetter(0), output) else 'ok'
return messages, status, False