[binutils-gdb] [gdb/contrib] Rename license-check-new-files.sh to .py
Tom de Vries via Gdb-cvs <[email protected]> Thu, 18 Jun 2026 15:22:03 +0000 (GMT)
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b43d0708ad4a8f689040f0da40e5ca2de742dc76 commit b43d0708ad4a8f689040f0da40e5ca2de742dc76 Author: Tom de Vries <[email protected]> Date: Thu Jun 18 17:21:59 2026 +0200 [gdb/contrib] Rename license-check-new-files.sh to .py Rename gdb/contrib/license-check-new-files.sh to gdb/contrib/license-check-new-files.py. Fix the resulting flake8 fallout: ... gdb/contrib/license-check-new-files.py:58:5: E722 do not use bare 'except' gdb/contrib/license-check-new-files.py:106:9: E722 do not use bare 'except' ... Reviewed-By: Keith Seitz <[email protected]> Diff: --- .../{license-check-new-files.sh => license-check-new-files.py} | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb/contrib/license-check-new-files.sh b/gdb/contrib/license-check-new-files.py similarity index 97% rename from gdb/contrib/license-check-new-files.sh rename to gdb/contrib/license-check-new-files.py index b961780a23f..76fec06b33b 100755 --- a/gdb/contrib/license-check-new-files.sh +++ b/gdb/contrib/license-check-new-files.py @@ -31,11 +31,14 @@ # gdb/contrib/spellcheck.sh: no longer in repo? # gdbsupport/unordered_dense.h: MIT +import argparse import os import sys -import argparse from pathlib import PurePath + from git import Repo +from git.exc import NoSuchPathError +from gitdb.exc import BadName from scancode import api # A list of "common" licenses. If "--skip" is used, any file @@ -55,7 +58,7 @@ DEFAULT_SCAN_DIRS = "gdb*" def get_commit(repo, cstr): try: return repo.commit(cstr) - except: + except BadName: print(f'unknown commit "{cstr}"') sys.exit(2) @@ -103,7 +106,7 @@ def main(argv): try: repo = Repo(dir) break - except: + except NoSuchPathError: pass if dir == path.parents[-1]: