From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/contrib] Rename license-check-new-files.sh to .py
Date: Thu, 18 Jun 2026 14:57:55 +0200 [thread overview]
Message-ID: <20260618125755.40037-1-tdevries@suse.de> (raw)
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'
...
---
...nse-check-new-files.sh => license-check-new-files.py} | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
rename gdb/contrib/{license-check-new-files.sh => license-check-new-files.py} (97%)
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]:
base-commit: 69a6db768a5bec4bcef4855fa08ef15e13fc0488
--
2.51.0
next reply other threads:[~2026-06-18 12:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 12:57 Tom de Vries [this message]
2026-06-18 14:30 ` Keith Seitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260618125755.40037-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox