mottosso / Qt.py

Minimal Python 2 & 3 shim around all Qt bindings - PySide, PySide2, PyQt4 and PyQt5.
MIT License
914 stars 254 forks source link

_wrapInstance pointer type assert message in Py3 #362

Open YKdvd opened 3 years ago

YKdvd commented 3 years ago

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. https://github.com/mottosso/Qt.py/blob/54cbcbf51c621fea0074f9bb26af5c55862d57fd/Qt.py#L768 Should this message use something like "long.__name_\" instead so it more accurately print "long" on Python 2 and "int" on Python 3?

mottosso commented 3 years ago

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