From 3dd12b0cbe2138f4300fbe559e79e4c0fd0ab257 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 18 Oct 2025 07:05:05 +0000 Subject: [PATCH] chore(api): fix import ordering in download_manager and handlers --- unshackle/core/api/download_manager.py | 7 ++++--- unshackle/core/api/handlers.py | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unshackle/core/api/download_manager.py b/unshackle/core/api/download_manager.py index 7e2f0a4..4b87c17 100644 --- a/unshackle/core/api/download_manager.py +++ b/unshackle/core/api/download_manager.py @@ -6,11 +6,11 @@ import sys import tempfile import threading import uuid +from contextlib import suppress from dataclasses import dataclass, field +from datetime import datetime, timedelta from enum import Enum from typing import Any, Callable, Dict, List, Optional -from datetime import datetime, timedelta -from contextlib import suppress log = logging.getLogger("download_manager") @@ -87,14 +87,15 @@ def _perform_download( if cancel_event and cancel_event.is_set(): raise Exception(f"Job was cancelled {stage}") + from contextlib import redirect_stderr, redirect_stdout from io import StringIO - from contextlib import redirect_stdout, redirect_stderr _check_cancel("before execution started") # Import dl.py components lazily to avoid circular deps during module import import click import yaml + from unshackle.commands.dl import dl from unshackle.core.config import config from unshackle.core.services import Services diff --git a/unshackle/core/api/handlers.py b/unshackle/core/api/handlers.py index 60261a6..3b8dd1f 100644 --- a/unshackle/core/api/handlers.py +++ b/unshackle/core/api/handlers.py @@ -20,7 +20,6 @@ def initialize_proxy_providers() -> List[Any]: proxy_providers = [] try: from unshackle.core import binaries - # Load the main unshackle config to get proxy provider settings from unshackle.core.config import config as main_config