From 1dda60847ea1d404437a0fca8c61e4d374abf23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 20 Aug 2025 20:05:52 +0200 Subject: [PATCH] PLW0602: fix --- pkgs/clan-app/clan_app/api/file_gtk.py | 1 - pkgs/clan-cli/clan_cli/profiler.py | 1 - pkgs/clan-cli/clan_lib/async_run/__init__.py | 3 --- pkgs/clan-cli/clan_lib/cmd/__init__.py | 1 - 4 files changed, 6 deletions(-) diff --git a/pkgs/clan-app/clan_app/api/file_gtk.py b/pkgs/clan-app/clan_app/api/file_gtk.py index 2da3774da..a25a91c2c 100644 --- a/pkgs/clan-app/clan_app/api/file_gtk.py +++ b/pkgs/clan-app/clan_app/api/file_gtk.py @@ -91,7 +91,6 @@ def get_system_file( def gtk_open_file(file_request: FileRequest, op_key: str) -> bool: def returns(data: SuccessDataClass | ErrorDataClass) -> None: - global RESULT RESULT[op_key] = data def on_file_select(file_dialog: Gtk.FileDialog, task: Gio.Task) -> None: diff --git a/pkgs/clan-cli/clan_cli/profiler.py b/pkgs/clan-cli/clan_cli/profiler.py index 972f68e8f..802a5b103 100644 --- a/pkgs/clan-cli/clan_cli/profiler.py +++ b/pkgs/clan-cli/clan_cli/profiler.py @@ -100,7 +100,6 @@ def profile(func: Callable) -> Callable: """ def wrapper(*args: Any, **kwargs: Any) -> Any: - global PROFS profiler = PROFS[func] try: diff --git a/pkgs/clan-cli/clan_lib/async_run/__init__.py b/pkgs/clan-cli/clan_lib/async_run/__init__.py index 133d04d02..72d0ddeac 100644 --- a/pkgs/clan-cli/clan_lib/async_run/__init__.py +++ b/pkgs/clan-cli/clan_lib/async_run/__init__.py @@ -108,15 +108,12 @@ def set_should_cancel(should_cancel: Callable[[], bool]) -> None: def get_async_ctx() -> AsyncContext: """Retrieve the current AsyncContext, creating a new one if none exists.""" - global ASYNC_CTX_THREAD_LOCAL - if not hasattr(ASYNC_CTX_THREAD_LOCAL, "async_ctx"): ASYNC_CTX_THREAD_LOCAL.async_ctx = AsyncContext() return ASYNC_CTX_THREAD_LOCAL.async_ctx def set_async_ctx(ctx: AsyncContext) -> None: - global ASYNC_CTX_THREAD_LOCAL ASYNC_CTX_THREAD_LOCAL.async_ctx = ctx diff --git a/pkgs/clan-cli/clan_lib/cmd/__init__.py b/pkgs/clan-cli/clan_lib/cmd/__init__.py index 477063178..274430e3a 100644 --- a/pkgs/clan-cli/clan_lib/cmd/__init__.py +++ b/pkgs/clan-cli/clan_lib/cmd/__init__.py @@ -404,7 +404,6 @@ def run( if not is_async_cancelled(): process.wait() - global TIME_TABLE if TIME_TABLE: TIME_TABLE.add(shlex.join(cmd), timeit.default_timer() - start)