Modernise code for Python 3.9+

Following up from modernisations at !917 (merged) and addition of pre-commit hooks to the offline stack.

Merge request reports

Loading