scons/no_time-clock.patch
Tomáš Chvátal 3a0d7f1915 Accepting request 640345 from home:mcepl:work
- Block failing tests (and block %check section completely on
  non-Intel archs, as the tests are apparently not designed for
  that).
- FIx patches from the upstream to improve compatbiilty:
    fix-jN-for-python-37.patch
    fix-rpm-tests-for-newer-rpmbuild.patch
    no_deprecated_asserts.patch
    no_time-clock.patch
    removed_splitunc.patch
    replace_TestSuite_main.patch
    stop_custom_OrderedDict.patch

OBS-URL: https://build.opensuse.org/request/show/640345
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=62
2018-10-07 12:11:44 +00:00

32 lines
876 B
Diff

--- a/runtest.py
+++ b/runtest.py
@@ -92,8 +92,10 @@ try:
import threading
try: # python3
from queue import Queue
+ PY3=True
except ImportError as e: # python2
from Queue import Queue
+ PY3=False
threading_ok = True
except ImportError:
print("Can't import threading or queue")
@@ -764,10 +766,13 @@ os.environ["python_executable"] = python
# but time.time() does a better job on Linux systems, so let that be
# the non-Windows default.
-if sys.platform == 'win32':
- time_func = time.clock
-else:
- time_func = time.time
+try:
+ time_func = time.perf_counter
+except AttributeError:
+ if sys.platform == 'win32':
+ time_func = time.clock
+ else:
+ time_func = time.time
if print_times:
print_time_func = lambda fmt, time: sys.stdout.write(fmt % time)