Remove get_os_release() / compare_versions()
The sole purpose of these functions was to determine whether or not to use CLOCK_MONOTONIC_RAW (which is available on Linux 2.6.3+). Since we are no longer using CLOCK_MONOTONIC_RAW, they are not necessary.
This commit is contained in:
parent
a29eb9448c
commit
d261cf6808
13
monotonic.py
13
monotonic.py
|
@ -41,7 +41,6 @@
|
|||
import ctypes
|
||||
import ctypes.util
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
|
@ -50,18 +49,6 @@ import time
|
|||
__all__ = ('monotonic',)
|
||||
|
||||
|
||||
def get_os_release():
|
||||
"""Get the leading numeric component of the OS release."""
|
||||
return re.match('[\d.]+', platform.release()).group(0)
|
||||
|
||||
|
||||
def compare_versions(v1, v2):
|
||||
"""Compare two version strings."""
|
||||
def normalize(v):
|
||||
return map(int, re.sub(r'(\.0+)*$', '', v).split('.'))
|
||||
return cmp(normalize(v1), normalize(v2))
|
||||
|
||||
|
||||
try:
|
||||
monotonic = time.monotonic
|
||||
except AttributeError:
|
||||
|
|
Loading…
Reference in New Issue