summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-12-13 11:31:12 +0000
committerGerrit Code Review <review@openstack.org>2018-12-13 11:31:12 +0000
commit382370781bef900fae16687cc83d5e72d6769193 (patch)
treec61414e10042b5af602262fe43fc0f80c507fd72
parente67579790e4a0df05b712b58345be531f29914f5 (diff)
parentd7e70b11c638112113e765a90d4fa6f94e1ca553 (diff)
downloadoslo-utils-382370781bef900fae16687cc83d5e72d6769193.tar.gz
Merge "Don't use monotonic on Python >=3.3"3.39.0
-rw-r--r--oslo_utils/timeutils.py6
-rw-r--r--requirements.txt2
2 files changed, 6 insertions, 2 deletions
diff --git a/oslo_utils/timeutils.py b/oslo_utils/timeutils.py
index 117ae03..1e730a1 100644
--- a/oslo_utils/timeutils.py
+++ b/oslo_utils/timeutils.py
@@ -24,12 +24,16 @@ import time
from debtcollector import removals
import iso8601
-from monotonic import monotonic as now # noqa
import pytz
import six
from oslo_utils import reflection
+if hasattr(time, 'monotonic'):
+ now = time.monotonic
+else:
+ from monotonic import monotonic as now # noqa
+
# ISO 8601 extended time format with microseconds
_ISO8601_TIME_FORMAT_SUBSECOND = '%Y-%m-%dT%H:%M:%S.%f'
_ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
diff --git a/requirements.txt b/requirements.txt
index 803e5a6..9e3c458 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,7 +12,7 @@ six>=1.10.0 # MIT
funcsigs>=1.0.0;python_version=='2.7' or python_version=='2.6' # Apache-2.0
iso8601>=0.1.11 # MIT
oslo.i18n>=3.15.3 # Apache-2.0
-monotonic>=0.6 # Apache-2.0
+monotonic>=0.6;python_version<'3.3' # Apache-2.0
pytz>=2013.6 # MIT
netaddr>=0.7.18 # BSD
netifaces>=0.10.4 # MIT