Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/qasync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# If QT_API env variable is given, use that or fail trying
qtapi_env = os.getenv("QT_API", "").strip().lower()
if qtapi_env:
if qtapi_env: # pragma: no cover
env_to_mod_map = {
"pyqt5": "PyQt5",
"pyqt6": "PyQt6",
Expand All @@ -51,14 +51,14 @@
QtModule = importlib.import_module(QtModuleName)

# If a Qt lib is already imported, use that
if not QtModule:
if not QtModule: # pragma: no cover
for QtModuleName in ("PyQt5", "PyQt6", "PySide2", "PySide6"):
if QtModuleName in sys.modules:
QtModule = sys.modules[QtModuleName]
break

# Try importing qt libs
if not QtModule:
if not QtModule: # pragma: no cover
for QtModuleName in ("PyQt5", "PyQt6", "PySide2", "PySide6"):
try:
QtModule = importlib.import_module(QtModuleName)
Expand Down Expand Up @@ -180,7 +180,7 @@ def __init__(self, max_workers=10, stack_size=None):
super().__init__()
self.__max_workers = max_workers
self.__queue = Queue()
if stack_size is None:
if stack_size is None: # pragma: no cover
# Match cpython/Python/thread_pthread.h
if sys.platform.startswith("darwin"):
stack_size = 16 * 2**20
Expand Down
2 changes: 1 addition & 1 deletion src/qasync/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def with_logger(cls):
module = cls.__module__
if module is not None:
cls_name = module + "." + cls_name
else:
else: # pragma: no cover
raise AssertionError
setattr(cls, attr_name, logging.getLogger(cls_name))
return cls
Loading