Directly use monotonic.monotonic (vs optionally using it)

This commit is contained in:
Joshua Harlow
2015-06-10 17:43:27 -07:00
parent 6bb5017f6a
commit 65d3918217
3 changed files with 3 additions and 13 deletions

View File

@@ -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

View File

@@ -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__)

View File

@@ -26,6 +26,7 @@ with open("README.rst", "r") as readme:
install_requires = [
'six',
'monotonic>=0.1',
]
setup(