Fix remaining Ruff errors with GPT-5.6 Sol high

https://gist.github.com/simonw/6da7906a9fea6e90da131c21a9055199
This commit is contained in:
Simon Willison 2026-07-25 14:39:35 -07:00
commit 48ef55152c
16 changed files with 164 additions and 190 deletions

View file

@ -1,9 +1,7 @@
#!/usr/bin/env python3
import inspect
import sys
from pathlib import Path
from subprocess import PIPE, Popen, check_output
from subprocess import PIPE, CalledProcessError, Popen, check_output
# This file is execfile()d with the current directory set to its
# containing dir.
@ -49,7 +47,7 @@ extlinks = {
def _linkcode_git_ref():
try:
return check_output(["git", "rev-parse", "HEAD"]).decode("utf8").strip()
except Exception:
except (CalledProcessError, OSError):
return "main"
@ -78,7 +76,7 @@ def linkcode_resolve(domain, info):
obj = inspect.unwrap(obj)
source_file = inspect.getsourcefile(obj)
_, line_number = inspect.getsourcelines(obj)
except Exception:
except (OSError, TypeError, ValueError):
return None
if source_file is None: