Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion oauth2_clientd/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ def token_needs_refreshing(token: Dict[str, Any], threshold: int) -> bool:
return token['expires_at'] + threshold > time.time()

def get_boottime() -> int:
return int(time.clock_gettime(time.CLOCK_BOOTTIME))
try:
val = int(time.clock_gettime(time.CLOCK_BOOTTIME))
except AttributeError:
val = int(time.clock_gettime(time.CLOCK_MONOTONIC))
return val

# This is a workaround. All implementations of sleep() in Python use
# CLOCK_MONOTONIC, which has the advantage of never going backward but it
Expand Down