-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Python 3 and capstone #93
Comments
yes, Python 3 support is still lacking. if you can make the current Python thanks! |
btw, i dont believe that simply moving code around (to init.py) like thanks. On Fri, Apr 11, 2014 at 7:12 AM, Nguyen Anh Quynh aquynh@gmail.com wrote:
|
Almost. I already moved |
cool! is it possible to support both Python2 & Python3 with the same code? would your work would be appreciated by lots of people i think. thanks. On Fri, Apr 11, 2014 at 7:19 AM, fenuks notifications@github.com wrote:
|
Hi,
it's great that such excellent library such capstone is available for Python, but there is problem with Python 3, since it doesn't supporting relative imports in contrary to Python 2.
So instead doing in
__init__.py
from capstone import Cs # other imports omitted for sake of clarity
you can do it this way:from . import Cs
. In my opinion it would be even better to remove module capstone.py file and move its contents directly to__init__.py
. Other modules also need to be slighty corrected.Beside that, in some distributions like Arch, python is symbolic link to python3 or to be exact to python3.4 so building bindings fails due to Python2-style prints. It can be easily fixed, e.g. in test.py prints are Python 3 friendly (except line 47
print to_hex(code)
, but you forgot to dofrom __future__ import print_function
). If you want, I can fix these defects and create pull request.The text was updated successfully, but these errors were encountered: