File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,10 @@ def parse_optional_tags(
241
241
242
242
tags : dict [str , Union [str , None ]] = {}
243
243
for m in optional_regex .finditer (comment ):
244
- cmd = m .group ("cmd" ).lower ()
244
+ cmd = m .group ("cmd" ).lower ().strip ()
245
+ if cmd == "" :
246
+ # skip empty tags
247
+ continue
245
248
if cmd == "known bug" :
246
249
value = None
247
250
if m .groups ("tags" ) and m .group ("tags" ).strip ().lower ().startswith ("linux" ):
@@ -252,13 +255,14 @@ def parse_optional_tags(
252
255
# rename 'known bug' to 'bug' so that such tests will be run by sage -t ... -only-optional=bug
253
256
tags ["bug" ] = value
254
257
elif cmd not in ["optional" , "needs" ]:
255
- tags [cmd . lower () ] = m .group ("cmd_explanation" ) or None
258
+ tags [cmd ] = m .group ("cmd_explanation" ) or None
256
259
else :
257
260
# other tags with additional values
258
261
tags_with_value = {
259
- m .group (1 ).lower (): m .group (2 ) or None
262
+ m .group (1 ).lower (). strip () : m .group (2 ) or None
260
263
for m in tag_with_explanation_regex .finditer (m .group ("tags" ))
261
264
}
265
+ tags_with_value .pop ("" , None )
262
266
tags .update (tags_with_value )
263
267
264
268
if return_string_sans_tags :
You can’t perform that action at this time.
0 commit comments