[test] Fix modutils tests when running inside a python 3 virtualenv (closes #294756) [applied]