mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-18 08:54:50 -05:00
rpcserver.py: perf_counter_ns is Python 3.7+
perf_counter_ns is only available in Python 3.7 and later. Define a lambda for 3.6 and lower. Fixes: https://pagure.io/freeipa/issue/8891 Signed-off-by: François Cami <fcami@redhat.com> Reviewed-By: Stanislav Levin <slev@altlinux.org> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
69497f4a02
commit
06791db5fa
@@ -31,6 +31,7 @@ import os
|
||||
import time
|
||||
import traceback
|
||||
from io import BytesIO
|
||||
from sys import version_info
|
||||
from urllib.parse import parse_qs
|
||||
from xmlrpc.client import Fault
|
||||
|
||||
@@ -72,6 +73,10 @@ from requests.auth import AuthBase
|
||||
if six.PY3:
|
||||
unicode = str
|
||||
|
||||
# time.perf_counter_ns appeared in Python 3.7.
|
||||
if version_info < (3, 7):
|
||||
time.perf_counter_ns = lambda: int(time.perf_counter() * 10**9)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
HTTP_STATUS_SUCCESS = '200 Success'
|
||||
|
||||
Reference in New Issue
Block a user