Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval doesn't seem to work #20

Closed
ghost opened this issue Jun 20, 2018 · 1 comment
Closed

eval doesn't seem to work #20

ghost opened this issue Jun 20, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 20, 2018

If the following code is the correct way to call eval, it doesn't work (Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32). Not really use this, but maybe some Python modules do.

import nimpy

let py = pyBuiltinsModule()
echo py.eval("3+3").to(int)
nimpy.nim(1185)          callMethod
nimpy.nim(1182)          callMethodAux
nimpy.nim(1165)          raisePythonError
Error: unhandled exception: <class 'SystemError'>: frame does not exist [Exception]
@ghost
Copy link
Author

ghost commented Jul 17, 2018

I assume only direct calls to eval dont work, because the following does work:

file eval.py:

def eval_result(code):
  return eval(code)
import nimpy

#let py = pyBuiltinsModule()
let pyEval = pyImport("eval")
#echo py.eval("3+3").to(int)
echo pyEval.eval_result("3+3").to(int)

yglukhov added a commit that referenced this issue Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant