Python Version Compatibility with new CVS2 command
Usage of match
+case
statements at https://git.webis.de/code-generic/code-webis-cmd/-/blob/master/tools/cvs2.py#L154-162 requires Python 3.10. setup.py
only requires 3.6+. For older systems (Ubuntu 20.04) Python 3.8.10 is still the default.
It might be better to rewrite with if
/elif
for backwards compatibility:
if s == b'U':
err.print(f' [green]new: {f.decode()}[/green]', highlight=False)
elif s == b'M':
err.print(f' [green]modified: {f.decode()}[/green]', highlight=False)
elif s == b'R':
err.print(f' [red]removed: {f.decode()}[/red]', highlight=False)
elif s == b'C':
err.print(f' [red]CONFLICT: {f.decode()}[/red]', highlight=False)
(Similar to lines 90+.)