diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-03-18 03:24:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-18 03:24:59 (GMT) |
commit | 1cab44d8650ae3eece90b04fca373908205e7ee0 (patch) | |
tree | 727dc1f496b57558387a3585edde0678b67a8494 /Lib/unittest/main.py | |
parent | e808c9d5c78e5a7a9d804eced013a02c0c7df1a5 (diff) | |
download | cpython-1cab44d8650ae3eece90b04fca373908205e7ee0.zip cpython-1cab44d8650ae3eece90b04fca373908205e7ee0.tar.gz cpython-1cab44d8650ae3eece90b04fca373908205e7ee0.tar.bz2 |
[3.9] bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654) (GH-31970)
(cherry picked from commit a0db11b10fca0fee6bb2b8d6277e266bad8c0fdb)
Co-authored-by: Bader Zaidan <bader@zaidan.pw>
Diffstat (limited to 'Lib/unittest/main.py')
-rw-r--r-- | Lib/unittest/main.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py index e62469a..88a188c 100644 --- a/Lib/unittest/main.py +++ b/Lib/unittest/main.py @@ -39,7 +39,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): |