diff --git a/ChangeLog b/ChangeLog index fbb2568..e4cfabb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - Allow providing a non-standard (eventlet or other condition class) to the r/w lock for cases where it is useful to do so. + - Directly use monotonic.monotonic. 0.8: - Add fastener logo (from openclipart). - Ensure r/w writer -> reader -> writer diff --git a/fasteners/_utils.py b/fasteners/_utils.py index affa5ac..d65f903 100644 --- a/fasteners/_utils.py +++ b/fasteners/_utils.py @@ -17,20 +17,8 @@ # under the License. import logging -import time -# Use monotonic time in stopwatches if we can get at it... -# -# PEP @ https://www.python.org/dev/peps/pep-0418/ -try: - now = time.monotonic -except AttributeError: - try: - # Try to use the pypi module if it's available (optionally...) - from monotonic import monotonic as now - except (AttributeError, ImportError): - # Ok fallback to the non-monotonic one... - now = time.time +from monotonic import monotonic as now # noqa LOG = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index f5c79dd..1c4ef20 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ with open("README.rst", "r") as readme: install_requires = [ 'six', + 'monotonic>=0.1', ] setup(