From 3545d262088017aa8e0802d52075470a1eff6073 Mon Sep 17 00:00:00 2001 From: Xavier Deguillard Date: Fri, 31 Jan 2020 10:10:12 -0800 Subject: [PATCH] tests-rustthreading.py: the thread is renamed to _thread Summary: The module no longer exist in Python3, it has been renamed. Reviewed By: quark-zju Differential Revision: D19663426 fbshipit-source-id: a805e7fa3d15335a0be4f6a8d8ae096328470728 --- eden/scm/tests/test-rustthreading.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eden/scm/tests/test-rustthreading.py b/eden/scm/tests/test-rustthreading.py index 472a686ada..b0afe9a5a3 100644 --- a/eden/scm/tests/test-rustthreading.py +++ b/eden/scm/tests/test-rustthreading.py @@ -50,17 +50,23 @@ from __future__ import absolute_import import os -import thread import threading import time import unittest -from thread import get_ident, start_new_thread import silenttestrunner from bindings import threading as rustthreading from hghave import require +try: + import thread + from thread import get_ident, start_new_thread +except ImportError: + import _thread as thread + from _thread import get_ident, start_new_thread + + require(["py2"])