tools/utils.py: oh, some code duplication

2 jobs for test/code-quality-duplicate in 2 minutes and 49 seconds (queued for 3 seconds)
latest