[3.12] gh-109413: libregrtest: Backport .py-file changes from #112558 (#112558)
#112605
+18
−12
.py-file changes from #112558 (#112558)
#112605