diff --git a/lib/galaxy/app.py b/lib/galaxy/app.py index 602eb20e0a5e..fa36beb242d5 100644 --- a/lib/galaxy/app.py +++ b/lib/galaxy/app.py @@ -133,13 +133,13 @@ build_tours_registry, ToursRegistry, ) +from galaxy.util import user_agent # noqa: F401 from galaxy.util import ( ExecutionTimer, heartbeat, listify, StructuredExecutionTimer, ) -from galaxy.util import user_agent # noqa: F401 from galaxy.util.task import IntervalTask from galaxy.util.tool_shed import tool_shed_registry from galaxy.visualization.data_providers.registry import DataProviderRegistry diff --git a/lib/galaxy/tools/data_fetch.py b/lib/galaxy/tools/data_fetch.py index 9f7fa4b9d307..fcf92be724d6 100644 --- a/lib/galaxy/tools/data_fetch.py +++ b/lib/galaxy/tools/data_fetch.py @@ -26,11 +26,11 @@ stream_to_file, stream_url_to_file, ) +from galaxy.util import user_agent # noqa: F401 from galaxy.util import ( in_directory, safe_makedirs, ) -from galaxy.util import user_agent # noqa: F401 from galaxy.util.bunch import Bunch from galaxy.util.compression_utils import CompressedFile from galaxy.util.hash_util import ( diff --git a/lib/galaxy/util/user_agent.py b/lib/galaxy/util/user_agent.py index a2241b3dd5db..4e914d816ccb 100644 --- a/lib/galaxy/util/user_agent.py +++ b/lib/galaxy/util/user_agent.py @@ -25,9 +25,7 @@ def modify_user_agent_header(header): def new_build_opener(*handlers): opener = old_build_opener(*handlers) - opener.addheaders = [ - modify_user_agent_header(header) for header in opener.addheaders - ] + opener.addheaders = [modify_user_agent_header(header) for header in opener.addheaders] return opener urllib.request.build_opener = new_build_opener