From 13f86c598ace9525e9c348e6dd2eaec57a082496 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Sun, 8 Nov 2015 13:01:29 +0800 Subject: [PATCH] PYTHON-1009 Switch from "Monotime" to "monotonic" --- README.rst | 2 +- doc/installation.rst | 2 +- pymongo/monotonic.py | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index f59e213e8..2211efe09 100644 --- a/README.rst +++ b/README.rst @@ -91,7 +91,7 @@ Optional packages: performance on Python older than 2.7.8, or on Python 3 before Python 3.4. - `pykerberos `_ is required for the GSSAPI authentication mechanism. -- `Monotime `_ adds support for +- `monotonic `_ adds support for a monotonic clock, which improves reliability in environments where clock adjustments are frequent. Not needed in Python 3.3+. - `wincertstore `_ adds support diff --git a/doc/installation.rst b/doc/installation.rst index 521026a9c..dedcaace5 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -21,7 +21,7 @@ packages: performance on Python older than 2.7.8, or on Python 3 before Python 3.4. - `pykerberos `_ is required for the GSSAPI authentication mechanism. -- `Monotime `_ adds support for +- `monotonic `_ adds support for a monotonic clock, which improves reliability in environments where clock adjustments are frequent. Not needed in Python 3.3+. - `wincertstore `_ adds support diff --git a/pymongo/monotonic.py b/pymongo/monotonic.py index 106546ded..2298ee032 100644 --- a/pymongo/monotonic.py +++ b/pymongo/monotonic.py @@ -25,8 +25,12 @@ except ImportError: pass try: - # Monotime or Python 3.3+. - from time import monotonic as time + # From https://pypi.python.org/pypi/monotinic. + from monotonic import monotonic as time except ImportError: - # Not monotonic. - from time import time + try: + # Monotime or Python 3.3+. + from time import monotonic as time + except ImportError: + # Not monotonic. + from time import time