Commit 0b88012
committed
Use onexc callback where supported
The shutil.rmtree callback defined as a local function in
git.util.rmtree was already capable of being used as both the old
onerror parameter and the new onexc parameter--introduced in Python
3.12, which also deprecates onerror--because they differ only in
the meaning of their third parameter (excinfo), which the callback
defined in git.util.rmtree does not use.
This modifies git.util.rmtree to pass it as onexc on 3.12 and
later, while still passing it as onerror on 3.11 and earlier.
Because the default value of ignore_errors is False, this makes the
varying logic clearer by omitting that argument and using a keyword
argument both when passing onexc (which is keyword-only) and when
passing onerror (which is not keyword-only but can only be passed
positionally if ignore_errors is passed explicitly).1 parent ccbb273 commit 0b88012
1 file changed
+12
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
| |||
75 | 70 | | |
76 | 71 | | |
77 | 72 | | |
78 | | - | |
79 | 73 | | |
80 | 74 | | |
81 | 75 | | |
| |||
88 | 82 | | |
89 | 83 | | |
90 | 84 | | |
91 | | - | |
92 | 85 | | |
93 | 86 | | |
94 | 87 | | |
| |||
182 | 175 | | |
183 | 176 | | |
184 | 177 | | |
185 | | - | |
| 178 | + | |
186 | 179 | | |
187 | 180 | | |
188 | 181 | | |
| |||
195 | 188 | | |
196 | 189 | | |
197 | 190 | | |
198 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
199 | 195 | | |
200 | 196 | | |
201 | 197 | | |
| |||
995 | 991 | | |
996 | 992 | | |
997 | 993 | | |
998 | | - | |
| 994 | + | |
999 | 995 | | |
1000 | 996 | | |
1001 | 997 | | |
| |||
0 commit comments