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

python2 support for pyhermes #91

Merged
merged 5 commits into from
Nov 13, 2017
Merged

python2 support for pyhermes #91

merged 5 commits into from
Nov 13, 2017

Conversation

Lagovas
Copy link
Contributor

@Lagovas Lagovas commented Nov 13, 2017

PyArg_ParseTupleAndKeywords doesn't support y# format in python2 (https://docs.python.org/2/c-api/arg.html) so I replaced it with s# that works on python2/3

Py_BuildValue doesn't support y# too and s# format will not work on python3 because it will try convert raw bytes to utf-8, so I replaced it with PyBytes usage that works on python2/3 (https://docs.python.org/3/howto/cporting.html#str-unicode-unification)

plus replaced PyObject_CallMethod with PyObject_CallMethodObjArgs which takes PyObject from PyBytes and works similarly on py2/3

@vixentael
Copy link
Contributor

I'll check on MacOS later

@vixentael vixentael merged commit 0bb8c42 into master Nov 13, 2017
@vixentael
Copy link
Contributor

I checked, everything is good.

thank you @Lagovas

@Lagovas Lagovas deleted the lagovas/python2-pyhermes branch November 16, 2017 09:55
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

Successfully merging this pull request may close these issues.

2 participants