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

Error checking for pyObjToNim conversions #32

Closed
LemonBoy opened this issue Aug 8, 2018 · 0 comments
Closed

Error checking for pyObjToNim conversions #32

LemonBoy opened this issue Aug 8, 2018 · 0 comments

Comments

@LemonBoy
Copy link
Contributor

LemonBoy commented Aug 8, 2018

A small example:

let py = pyBuiltinsModule()
echo py.chr(65).to(int)

The chr function returns a string but the to(int) tries a conversion to int and PyLong_AsLongLong returns -1 to signal this. Checking for PyErr_Occurred or using the <type>_Check procedures may help here.

LemonBoy added a commit to LemonBoy/nimpy that referenced this issue Aug 13, 2018
LemonBoy added a commit to LemonBoy/nimpy that referenced this issue Aug 13, 2018
LemonBoy added a commit to LemonBoy/nimpy that referenced this issue Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant