Skip to content
This repository has been archived by the owner on Apr 10, 2021. It is now read-only.

Commit

Permalink
Remove get_os_release() / compare_versions()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
atdt committed Dec 27, 2015
1 parent a29eb94 commit d261cf6
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions monotonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import ctypes
import ctypes.util
import os
import platform
import re
import sys
import time
Expand All @@ -50,18 +49,6 @@
__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:
Expand Down

0 comments on commit d261cf6

Please sign in to comment.