From ee5f59fdf4984646347d66676f5f7dd478edbe4e Mon Sep 17 00:00:00 2001 From: bashonly Date: Tue, 29 Jul 2025 17:59:05 -0500 Subject: [PATCH] [test:utils] Fix `sanitize_path` test for Python 3.11 on Windows Authored by: bashonly --- test/test_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_utils.py b/test/test_utils.py index 44747efda6..534dfb0fbb 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -249,11 +249,13 @@ def test_sanitize_path(self): self.assertEqual(sanitize_path('abc.../def...'), 'abc..#\\def..#') self.assertEqual(sanitize_path('C:\\abc:%(title)s.%(ext)s'), 'C:\\abc#%(title)s.%(ext)s') - # Check with nt._path_normpath if available + # If nt._path_normpath is available, test with os.path.normpath try: - from nt import _path_normpath as nt_path_normpath + from nt import _path_normpath as _ # noqa: F401 except ImportError: nt_path_normpath = None + else: + from os.path import normpath as nt_path_normpath for test, expected in [ ('C:\\', 'C:\\'),