diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-03-18 00:00:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-18 00:00:52 (GMT) |
commit | 0b5f99ad1af0892a2d6043abd8aeb10d685d3844 (patch) | |
tree | 744f62e67d671917cc7b2d3461c8d74fd752c332 /Lib/unittest | |
parent | ba76f901923d80ad9b24bb1636aa751d55e0c768 (diff) | |
download | cpython-0b5f99ad1af0892a2d6043abd8aeb10d685d3844.zip cpython-0b5f99ad1af0892a2d6043abd8aeb10d685d3844.tar.gz cpython-0b5f99ad1af0892a2d6043abd8aeb10d685d3844.tar.bz2 |
bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654)
(cherry picked from commit a0db11b10fca0fee6bb2b8d6277e266bad8c0fdb)
Co-authored-by: Bader Zaidan <bader@zaidan.pw>
Diffstat (limited to 'Lib/unittest')
-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): |