Skip to content

Commit 65d01fe

Browse files
authored
Fix exception when Python is run with -OO (#268)
* Don't assume __doc__ is present * use correct method
1 parent 3410c3a commit 65d01fe

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [2.4.2] - 2019-02-22
9+
10+
### Fixed
11+
12+
- Fixed exception when Python runs with -OO
13+
814
## [2.4.1] - 2019-02-20
915

1016
### Fixed

fs/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version, used in module and setup.py.
22
"""
3-
__version__ = "2.4.1"
3+
__version__ = "2.4.2"

fs/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ def _method(*args, **kwargs):
7777
)
7878
return method(*args, **kwargs)
7979

80-
_method.__doc__ += """
80+
deprecated_msg = """
8181
Note:
8282
.. deprecated:: 2.2.0
8383
Please use `~{}`
8484
""".format(
8585
method.__name__
8686
)
87+
if getattr(_method, "__doc__"):
88+
_method.__doc__ += deprecated_msg
8789

8890
return _method
8991

0 commit comments

Comments
 (0)