Skip to content

Commit

Permalink
Handle path behaviour change in Python 3.12.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Oct 27, 2023
1 parent 3bbe66e commit 20bcca3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test cases/common/220 fs module/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20bcca3

Please sign in to comment.