@@ -151,7 +151,11 @@ for line in fin:
151
151
# Match the author line and extract the part we want
152
152
# (Don't use startswith to allow Author override inside commit message.)
153
153
elif "Author:" in line:
154
- authorList = re.split(": ", line, 1)
154
+ if sys.version_info >= (3, 13, ):
155
+ authorList = re.split(": ", line, maxsplit=1)
156
+ else:
157
+ authorList = re.split(": ", line, 1)
158
+
155
159
try:
156
160
author = authorList[1]
157
161
author = author[0 : len(author) - fin_chop]
@@ -169,7 +173,11 @@ for line in fin:
169
173
170
174
# Match the date line
171
175
elif line.startswith("Date:"):
172
- dateList = re.split(": ", line, 1)
176
+ if sys.version_info >= (3, 13, ):
177
+ dateList = re.split(": ", line, maxsplit=1)
178
+ else:
179
+ dateList = re.split(": ", line, 1)
180
+
173
181
try:
174
182
date = dateList[1]
175
183
date = date[0 : len(date) - fin_chop]
@@ -213,7 +221,11 @@ for line in fin:
213
221
continue
214
222
# Collect the files for this commit. FIXME: Still need to add +/- to files
215
223
elif authorFound and dateFound and messageFound:
216
- fileList = re.split(r' \| ', line, 2)
224
+ if sys.version_info >= (3, 13, ):
225
+ fileList = re.split(r' \| ', line, maxsplit=2)
226
+ else:
227
+ fileList = re.split(r' \| ', line, 2)
228
+
217
229
if len(fileList) > 1:
218
230
if len(files) > 0:
219
231
files = files + ", " + fileList[0].strip()
0 commit comments