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

_wrapInstance pointer type assert message in Py3 #362

Open
YKdvd opened this issue Sep 7, 2021 · 1 comment
Open

_wrapInstance pointer type assert message in Py3 #362

YKdvd opened this issue Sep 7, 2021 · 1 comment

Comments

@YKdvd
Copy link

YKdvd commented Sep 7, 2021

Qt.py checks whether "long" is defined, and if it isn't (for Python 3.x) defines it as "int". The _wrapinstance() function has an assertion to ensure that the 'ptr' parameter passed is of this type. But the assertion message uses a hardcoded '' phrase, so on Python 3 seems to be saying that the parameter should be of the nonexistent "long" type.

Qt.py/Qt.py

Line 768 in 54cbcbf

assert isinstance(ptr, long), "Argument 'ptr' must be of type <long>"

Should this message use something like "long.__name__" instead so it more accurately print "long" on Python 2 and "int" on Python 3?

@mottosso
Copy link
Owner

mottosso commented Sep 8, 2021

Ah, yes good idea. Can you submit a PR for this? I can get this merged quickly.

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

2 participants