Skip to content

Commit

Permalink
Fix for tests: Python 3.13.0a6 renamed pathmod to parser (#2702)
Browse files Browse the repository at this point in the history
Co-authored-by: Bernát Gábor <bgabor8@bloomberg.net>
Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
  • Loading branch information
3 people authored Apr 17, 2024
1 parent cafd263 commit 97438d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
py:
- "3.13.0-alpha.2"
- "3.13.0-alpha.6"
- "3.12"
- "3.11"
- "3.10"
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2702.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Python 3.13.0a6 renamed pathmod to parser.
8 changes: 4 additions & 4 deletions tests/unit/create/via_global_ref/builtin/testing/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class PathMockABC(FakeDataABC, Path):
# Allows to pass some tests for Windows via PosixPath.
_flavour.altsep = _flavour.altsep or "\\"

# Python 3.13 renamed _flavour to pathmod
pathmod = getattr(Path(), "pathmod", None)
if hasattr(pathmod, "altsep"):
pathmod.altsep = pathmod.altsep or "\\"
# Python 3.13 renamed _flavour to parser
parser = getattr(Path(), "parser", None)
if hasattr(parser, "altsep"):
parser.altsep = parser.altsep or "\\"

def exists(self):
return self.is_file() or self.is_dir()
Expand Down

0 comments on commit 97438d9

Please sign in to comment.