Skip to content
This repository was archived by the owner on May 2, 2026. It is now read-only.
Open
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
9 changes: 7 additions & 2 deletions space/tle/celestrak.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import logging
import asyncio
import aiohttp
import async_timeout
import re
import requests
from bs4 import BeautifulSoup
import sys

if sys.version_info >= (3, 11):
from asyncio import timeout
else:
from async_timeout import timeout

from .common import TMP_FOLDER
from ..wspace import ws
Expand Down Expand Up @@ -116,7 +121,7 @@ async def _fetch_file(session, filename):

When the page is totally retrieved, the function will call insert
"""
with async_timeout.timeout(30):
async with timeout(30):
async with session.get(CELESTRAK_URL.format(filename)) as response:
text = await response.text()

Expand Down