Don't use monotonic on Python >=3.3

A change to the global-requirements[1] has limited use of the monotonic
library to Python versions earlier than 3.3 (later versions have
built-in support for a monotonic clock), so no requirements changes can
be merged until we similarly limit it in requirements.txt.

[1] https://review.openstack.org/615441

Change-Id: Ib53d89ea820d21114d10280c9f4ab1b0c2c4a4bc
This commit is contained in:
Zane Bitter 2018-12-03 12:29:00 +13:00
parent fde490f22d
commit d7e70b11c6
2 changed files with 6 additions and 2 deletions

View File

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

View File

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