bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654)

This commit is contained in:
Bader Zaidan 2022-03-18 00:37:52 +01:00 committed by GitHub
parent ac8308d3ea
commit a0db11b10f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 1 deletions

View file

@ -40,7 +40,7 @@ def _convert_name(name):
name = rel_path
# on Windows both '\' and '/' are used as path
# separators. Better to replace both than rely on os.path.sep
return name[:-3].replace('\\', '.').replace('/', '.')
return os.path.normpath(name)[:-3].replace('\\', '.').replace('/', '.')
return name
def _convert_names(names):