eric7/MicroPython/MicroPythonSerialPort.py

branch
eric7
changeset 8318
962bce857696
parent 8312
800c432b34c8
child 8881
54e42bc2437a
diff -r 0c7a44af84bc -r 962bce857696 eric7/MicroPython/MicroPythonSerialPort.py
--- a/eric7/MicroPython/MicroPythonSerialPort.py	Sun May 16 11:43:59 2021 +0200
+++ b/eric7/MicroPython/MicroPythonSerialPort.py	Sun May 16 20:07:24 2021 +0200
@@ -8,8 +8,8 @@
 MicroPython devices.
 """
 
-from PyQt5.QtCore import QIODevice, QTime, QCoreApplication, QEventLoop
-from PyQt5.QtSerialPort import QSerialPort
+from PyQt6.QtCore import QIODevice, QTime, QCoreApplication, QEventLoop
+from PyQt6.QtSerialPort import QSerialPort
 
 
 class MicroPythonSerialPort(QSerialPort):
@@ -106,8 +106,7 @@
         data = bytearray()
         self.__timedOut = False
         
-        t = QTime()
-        t.start()
+        t = QTime.currentTime()
         while True:
             QCoreApplication.processEvents(
                 QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents)
@@ -118,7 +117,7 @@
                     break
                 if size is not None and len(data) >= size:
                     break
-            if t.elapsed() > self.__timeout:
+            if t.msecsTo(QTime.currentTime()) > self.__timeout:
                 self.__timedOut = True
                 break
         

eric ide

mercurial