Skip to content

Commit 1d50c06

Browse files
committed
v2.0.2
-------- 2022-06-03: define __fspath__ only on python >= 3.10
1 parent 6ef8167 commit 1d50c06

7 files changed

Lines changed: 23 additions & 8 deletions

File tree

.docs/README_template.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pathlib3x
22
=========
33

44

5-
Version v2.0.1 as of 2022-06-03 see `Changelog`_
5+
Version v2.0.2 as of 2022-06-03 see `Changelog`_
66

77

88
.. include:: ./badges.rst

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Changelog
55
- new MINOR version for added functionality in a backwards compatible manner
66
- new PATCH version for backwards compatible bug fixes
77

8+
9+
v2.0.2
10+
--------
11+
2022-06-03: define __fspath__ only on python >= 3.10
12+
813
v2.0.1
914
--------
1015
2022-06-03: use io.encoding only on 3.10 upwards

README.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pathlib3x
22
=========
33

44

5-
Version v2.0.1 as of 2022-06-03 see `Changelog`_
5+
Version v2.0.2 as of 2022-06-03 see `Changelog`_
66

77
|build_badge| |license| |pypi| |pypi-downloads| |black|
88

@@ -469,6 +469,11 @@ Changelog
469469
- new MINOR version for added functionality in a backwards compatible manner
470470
- new PATCH version for backwards compatible bug fixes
471471

472+
473+
v2.0.2
474+
--------
475+
2022-06-03: define __fspath__ only on python >= 3.10
476+
472477
v2.0.1
473478
--------
474479
2022-06-03: use io.encoding only on 3.10 upwards

pathlib3x/__init__conf__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
name = "pathlib3x"
44
title = "backport of pathlib 3.10 to python 3.6, 3.7, 3.8, 3.9 with a few extensions"
5-
version = "v2.0.1"
5+
version = "v2.0.2"
66
url = "https://github.com/bitranox/pathlib3x"
77
author = "Robert Nowotny"
88
author_email = "bitranox@gmail.com"
@@ -17,7 +17,7 @@ def print_info() -> None:
1717
1818
backport of pathlib 3.10 to python 3.6, 3.7, 3.8, 3.9 with a few extensions
1919
20-
Version : v2.0.1
20+
Version : v2.0.2
2121
Url : https://github.com/bitranox/pathlib3x
2222
Author : Robert Nowotny
2323
Email : bitranox@gmail.com"""

pathlib3x/pathlib3x.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,11 @@ def __str__(self):
554554
self._str = self._format_parsed_parts(self._drv, self._root, self._parts) or "."
555555
return self._str
556556

557-
def __fspath__(self):
558-
return str(self)
557+
# bitranox - define __fspath__ only on python >= 3.10
558+
if sys.version_info >= (3, 10):
559+
560+
def __fspath__(self):
561+
return str(self)
559562

560563
def as_posix(self):
561564
"""Return the string representation of the path with forward (/)

pathlib3x/pathlib3x.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ class PurePath(PathLike[str]):
7575
def __new__(cls: type[Self], *args: StrPath) -> Self: ...
7676
def __hash__(self) -> int: ...
7777
def __eq__(self, other: object) -> bool: ...
78-
def __fspath__(self) -> str: ...
78+
# bitranox - define __fspath__ only on python >= 3.10
79+
if sys.version_info >= (3, 10):
80+
def __fspath__(self) -> str: ...
7981
def __lt__(self, other: PurePath) -> bool: ...
8082
def __le__(self, other: PurePath) -> bool: ...
8183
def __gt__(self, other: PurePath) -> bool: ...

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_line_data(line: str) -> str:
8484

8585
setup_kwargs: Dict[str, Any] = dict()
8686
setup_kwargs["name"] = "pathlib3x"
87-
setup_kwargs["version"] = "v2.0.1"
87+
setup_kwargs["version"] = "v2.0.2"
8888
setup_kwargs["url"] = "https://github.com/bitranox/pathlib3x"
8989
setup_kwargs["packages"] = find_packages()
9090
setup_kwargs["package_data"] = {"pathlib3x": ["py.typed", "*.pyi", "__init__.pyi"]}

0 commit comments

Comments
 (0)