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
This commit is contained in:
Xavier Deguillard 2020-01-31 10:10:12 -08:00 committed by Facebook Github Bot
parent 9643c72d6e
commit 3545d26208

View File

@ -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"])