summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prolog/engine.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/prolog/engine.py b/prolog/engine.py
index f0d1157..344c1d4 100644
--- a/prolog/engine.py
+++ b/prolog/engine.py
@@ -21,6 +21,8 @@ def create(code='', timeout=10):
return reply.get('id'), output
def ask(engine, query, timeout=10):
+ # Strip trailing whitespace and periods from the query.
+ query = query.rstrip().rstrip('.')
return send(engine, 'ask(({}),[])'.format(query), timeout=timeout)
def next(engine, n=1, timeout=10):