Fixed a fatal crash in PyQt5.