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

using types directly for python2/3 cross compatibility #101

Merged
merged 1 commit into from Jun 4, 2016
Merged

using types directly for python2/3 cross compatibility #101

merged 1 commit into from Jun 4, 2016

Conversation

anthraxx
Copy link
Contributor

@anthraxx anthraxx commented Jun 1, 2016

This fixes #100

@anthraxx
Copy link
Contributor Author

anthraxx commented Jun 1, 2016

new problem uncovered with python3:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/distorm3/sample.py", line 46, in <module>
    for (offset, size, instruction, hexdump) in iterable:
  File "/usr/lib/python3.5/site-packages/distorm3/__init__.py", line 549, in DecodeGenerator
    for index in xrange(used):
NameError: name 'xrange' is not defined

will add another commit for that

@anthraxx
Copy link
Contributor Author

anthraxx commented Jun 1, 2016

patch updated and tested with the sample file. works fine with python2 and python3 now, from my side I'm ready 😄

@gdabah
Copy link
Owner

gdabah commented Jun 4, 2016

Thanks, I will review/test and update.

@gdabah gdabah merged commit d90ab37 into gdabah:master Jun 4, 2016
@gdabah
Copy link
Owner

gdabah commented Jun 4, 2016

Actually it doesn't work well for Python 3.0 and older Pythons. I'm on it. Thanks anyway.

@anthraxx
Copy link
Contributor Author

anthraxx commented Jun 4, 2016 via email

@gdabah
Copy link
Owner

gdabah commented Jun 4, 2016

Damn it, even among the various Python 3.x it works differently. Yeah I was afraid it will break existing Python 2.x code base. Maybe we should make it conditional upon version?

@anthraxx
Copy link
Contributor Author

anthraxx commented Jun 4, 2016 via email

@gdabah
Copy link
Owner

gdabah commented Jun 4, 2016

Ok, I will think how to implement it. Thanks for your help. I will commit something in the next few hours, would appreciate if you will be able to take a look.

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.

consider implementing python3 bindings
2 participants