Skip to content

Commit

Permalink
asyncutils: Remove os.environ modification for qasync initialization
Browse files Browse the repository at this point in the history
Since qasync>=0.10.0 it correctly handles case insensitive QT_API env
variables.
  • Loading branch information
ales-erjavec authored and payno committed Feb 6, 2024
1 parent 1f92540 commit 80b543a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions orangecanvas/utils/asyncutils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import asyncio
from concurrent import futures
from typing import Optional

from AnyQt.QtCore import QCoreApplication, QThread
import qasync


def get_event_loop() -> asyncio.AbstractEventLoop:
Expand Down Expand Up @@ -32,13 +32,6 @@ def get_event_loop() -> asyncio.AbstractEventLoop:
if loop is not None:
return loop

qt_api = os.environ.get("QT_API", "").lower()
if qt_api == "pyqt5":
os.environ["QT_API"] = "PyQt5"
elif qt_api == "pyside2":
os.environ["QT_API"] = "PySide2"
import qasync

if loop is None:
loop = qasync.QEventLoop(app)
# Do not use qasync.QEventLoop's default executor which uses QThread
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"cachecontrol[filecache]",
"pip>=18.0",
"dictdiffer",
"qasync",
"qasync>=0.10.0",
"importlib_metadata; python_version<'3.8'",
)

Expand Down

0 comments on commit 80b543a

Please sign in to comment.