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