[PyQt] RuntimeError: super-class __init__() of type WbGitMainWindow was never called?

Barry Scott barry at barrys-emacs.org
Tue May 31 10:40:19 BST 2016


Here is a simplified example that shows a bizare error.
I am on Fedora 23 with python 3.4.3 PyQt 5.5.1 Qt 5.6 as packaged by Fedora.

$ cat qqq.py
from PyQt5 import QtWidgets

import sys

qapp = QtWidgets.QApplication( sys.argv )

class WbMainWindow(QtWidgets.QMainWindow):
    def __init__( self ):
        print( 'WbMainWindow.__init__' )
        super().__init__( self )


class WbGitMainWindow(WbMainWindow):
    def __init__( self, app ):
        print( 'WbGitMainWindow.__init__' )
        WbMainWindow.__init__( self )


main_window = WbGitMainWindow( qapp )

$ python3 qqq.py
WbGitMainWindow.__init__
WbMainWindow.__init__
Traceback (most recent call last):
  File "qqq.py", line 19, in <module>
    main_window = WbGitMainWindow( qapp )
  File "qqq.py", line 16, in __init__
    WbMainWindow.__init__( self )
  File "qqq.py", line 10, in __init__
    super().__init__( self )
RuntimeError: super-class __init__() of type WbGitMainWindow was never called


Barry



More information about the PyQt mailing list