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
Status Job ID Name Coverage
  Test Tools
passed #736315
test_tools

00:00:11

 
  Test Quality
passed #736316
code_quality

00:02:37