diff options
| author | Pacho Ramos <pacho@gentoo.org> | 2024-07-30 10:26:34 +0200 |
|---|---|---|
| committer | Pacho Ramos <pacho@gentoo.org> | 2024-07-30 10:48:02 +0200 |
| commit | 486c55ba97a201f95a09739806289129a076eb88 (patch) | |
| tree | f8a7498c31c0d59120dd32e5b3f4e503ba4bb018 /dev-vcs/gitstats/files/gitstats-0_pre20201124-py312.patch | |
| parent | 5a1b1a83989bf2b3e5894b91dbe5398b439f999f (diff) | |
| download | gentoo-486c55ba97a201f95a09739806289129a076eb88.tar.gz gentoo-486c55ba97a201f95a09739806289129a076eb88.tar.bz2 gentoo-486c55ba97a201f95a09739806289129a076eb88.zip | |
dev-vcs/gitstats: Support python 3.12
Thanks-to: Khumba
Closes: https://bugs.gentoo.org/929561
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Diffstat (limited to 'dev-vcs/gitstats/files/gitstats-0_pre20201124-py312.patch')
| -rw-r--r-- | dev-vcs/gitstats/files/gitstats-0_pre20201124-py312.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/dev-vcs/gitstats/files/gitstats-0_pre20201124-py312.patch b/dev-vcs/gitstats/files/gitstats-0_pre20201124-py312.patch new file mode 100644 index 000000000000..3896fd87e937 --- /dev/null +++ b/dev-vcs/gitstats/files/gitstats-0_pre20201124-py312.patch @@ -0,0 +1,44 @@ +From 4743c3fe184ce6e10d145c536af5b3689b069fc2 Mon Sep 17 00:00:00 2001 +From: Bryan Gardiner <bog@khumba.net> +Date: Fri, 14 Jun 2024 19:13:32 -0700 +Subject: [PATCH] Use raw strings for regexs to fix new SyntaxWarnings in + Python 3.12. + +--- + gitstats | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gitstats b/gitstats +index 9f14a0f..37005f3 100755 +--- a/gitstats ++++ b/gitstats +@@ -96,7 +96,7 @@ def getkeyssortedbyvaluekey(d, key): + return [el[1] for el in sorted([(d[el][key], el) for el in list(d.keys())])] + + def getstatsummarycounts(line): +- numbers = re.findall('\d+', line) ++ numbers = re.findall(r'\d+', line) + if len(numbers) == 1: + # neither insertions nor deletions: may probably only happen for "0 files changed" + numbers.append(0); +@@ -322,7 +322,7 @@ class GitDataCollector(DataCollector): + continue + prev = tag + for line in output.split('\n'): +- parts = re.split('\s+', line, 2) ++ parts = re.split(r'\s+', line, 2) + commits = int(parts[1]) + author = parts[2] + self.tags[tag]['commits'] += commits +@@ -485,7 +485,7 @@ class GitDataCollector(DataCollector): + for line in lines: + if len(line) == 0: + continue +- parts = re.split('\s+', line, 4) ++ parts = re.split(r'\s+', line, 4) + if parts[0] == '160000' and parts[3] == '-': + # skip submodules + continue +-- +2.44.2 + |
