From 20bcca39726803aba56fcc388332622d70605e1a Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 26 Oct 2023 22:09:30 +0300 Subject: [PATCH] Handle path behaviour change in Python 3.12. --- test cases/common/220 fs module/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test cases/common/220 fs module/meson.build b/test cases/common/220 fs module/meson.build index 7f113d66e..80019631f 100644 --- a/test cases/common/220 fs module/meson.build +++ b/test cases/common/220 fs module/meson.build @@ -39,7 +39,9 @@ assert(fs.expanduser('~/foo').endswith('foo'), 'expanduser with tail failed') # -- as_posix assert(fs.as_posix('/') == '/', 'as_posix idempotent') assert(fs.as_posix('\\') == '/', 'as_posix simple') -assert(fs.as_posix('\\\\') == '/', 'as_posix simple') +# Python 3.12 changed how these paths are handled, so deal with both. +drivepath = fs.as_posix('\\\\') +assert(drivepath == '/' or drivepath == '//', 'as_posix simple') assert(fs.as_posix('foo\\bar/baz') == 'foo/bar/baz', 'as_posix mixed slash') # -- is_absolute