File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ dynamic = ["version"]
88description = " Official Python command line client for tldr pages."
99readme = " README.md"
1010license = " MIT"
11- requires-python = " ~ =3.10"
11+ requires-python = " > =3.10"
1212authors = [
1313 { name = " Felix Yan and tldr-pages contributors" },
1414]
Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ def get_page_for_every_platform(
281281 return result
282282 # Know here that we don't have the info in cache
283283 result = list ()
284+ error = None
284285 for platform in platforms :
285286 for language in languages :
286287 if platform is None :
@@ -300,13 +301,22 @@ def get_page_for_every_platform(
300301 break
301302 except HTTPError as err :
302303 if err .code != 404 :
303- raise
304- except URLError :
304+ # Store error for later, only raise if we find no results at all
305+ error = err
306+ except URLError as err :
305307 if not PAGES_SOURCE_LOCATION .startswith ('file://' ):
306- raise
308+ # Store error for later, only raise if we find no results at all
309+ error = err
310+
307311 if result : # Return if smth was found
308312 return result
309313
314+ # Reraise the error if we couldn't get the pages for any platform
315+ if error is not None :
316+ # Note that only the most recent error will be stored and raised
317+ raise error
318+
319+ # Otherwise, we got no results nor errors, implies the documentation doesn't exist
310320 return False
311321
312322
You can’t perform that action at this time.
0 commit comments