pyqt / python-qt5

Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows
GNU General Public License v3.0
282 stars 79 forks source link

QFlags DeprecationWarning under Python 3.8 #49

Closed pjnagel closed 4 years ago

pjnagel commented 4 years ago

The following code prints out DeprecationWarning: an integer is required (got type DockOptions). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python when run under Python 3.8:

import sys

from PyQt5.QtWidgets import (
    QApplication,
    QMainWindow,
)

app = QApplication(sys.argv)
w = QMainWindow(dockOptions=QMainWindow.AllowNestedDocks | QMainWindow.AnimatedDocks)
w.show()
sys.exit(app.exec_())

The deprecation is explained in "What’s New In Python 3.8", Build and C API Changes, the bullet point about PyLong_AsLong

For reference, I was using PyQt5 5.13.1 installed as wheel from PyPi under Python3.8 from Ubuntu 19.10's stock apt repositories.

pjnagel commented 4 years ago

Ignore, I thought this was the issue tracker for upstream PyQt5