yuce / pyswip

PySwip is a Python-Prolog interface that enables querying SWI-Prolog in your Python programs.
https://pyswip.org
MIT License
482 stars 98 forks source link

cleanupProlog may try to convert generator to int #98

Open wvxvw opened 4 years ago

wvxvw commented 4 years ago

If the results of the last Prolog.query() call aren't consumed, then the _hook.exit_code will be a generator object. Converting it to an int will fail.

I think, the better way to deal with this is to check if the exit_code is a generator, and if so, warn the users about not executing all of the code they queried.

I'm talking about the file core.py, line 1358 in my version.