from PySide2 import QtCore
import time
import sys


class Producer(QtCore.QThread):
    def run(self):
        time.sleep(2)
        print('hi')


if __name__ == "__main__":    
    print(QtCore.QLibraryInfo.build())
    print(sys.version)
    app = QtCore.QCoreApplication(sys.argv)
    producer = Producer()
    producer.start()
    print("About to call Qthread.wait()")
    producer.wait()  # hangs
    print("Qthread finished")
