* [PATCH] [gdb/contrib] Rename license-check-new-files.sh to .py
@ 2026-06-18 12:57 Tom de Vries
2026-06-18 14:30 ` Keith Seitz
0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2026-06-18 12:57 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] [gdb/contrib] Rename license-check-new-files.sh to .py
2026-06-18 12:57 [PATCH] [gdb/contrib] Rename license-check-new-files.sh to .py Tom de Vries
@ 2026-06-18 14:30 ` Keith Seitz
0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2026-06-18 14:30 UTC (permalink / raw)
To: Tom de Vries, gdb-patches
Hi,
On 6/18/26 5:57 AM, Tom de Vries wrote:
> 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'
> ...
Thank you for doing this; it LGTM.
Reviewed-By: Keith Seitz <keiths@redhat.com>
Keith
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-18 14:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-18 12:57 [PATCH] [gdb/contrib] Rename license-check-new-files.sh to .py Tom de Vries
2026-06-18 14:30 ` Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox