Skip to content

Commit

Permalink
Fix exception when Python is run with -OO (#268)
Browse files Browse the repository at this point in the history
* Don't assume __doc__ is present

* use correct method
  • Loading branch information
willmcgugan authored Feb 22, 2019
1 parent 3410c3a commit 65d01fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.4.2] - 2019-02-22

### Fixed

- Fixed exception when Python runs with -OO

## [2.4.1] - 2019-02-20

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion fs/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version, used in module and setup.py.
"""
__version__ = "2.4.1"
__version__ = "2.4.2"
4 changes: 3 additions & 1 deletion fs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ def _method(*args, **kwargs):
)
return method(*args, **kwargs)

_method.__doc__ += """
deprecated_msg = """
Note:
.. deprecated:: 2.2.0
Please use `~{}`
""".format(
method.__name__
)
if getattr(_method, "__doc__"):
_method.__doc__ += deprecated_msg

return _method

Expand Down

0 comments on commit 65d01fe

Please sign in to comment.