File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818from collections import namedtuple
1919# import types, weakref # Deferred to single_dispatch()
2020from reprlib import recursive_repr
21- try :
22- from _thread import RLock
23- except ModuleNotFoundError :
24- from _dummy_thread import RLock
21+ from _thread import RLock
2522from types import GenericAlias
2623
2724
Original file line number Diff line number Diff line change 44
55import builtins
66from itertools import islice
7- try :
8- from _thread import get_ident
9- except ModuleNotFoundError :
10- from _dummy_thread import get_ident
7+ from _thread import get_ident
118
129def recursive_repr (fillvalue = '...' ):
1310 'Decorator to make a repr function return fillvalue for a recursive call'
Original file line number Diff line number Diff line change 4747import types as _types
4848import weakref as _weakref
4949
50- try :
51- import _thread
52- except ImportError :
53- import _dummy_thread as _thread
50+ import _thread
5451_allocate_lock = _thread .allocate_lock
5552
5653_text_openflags = _os .O_RDWR | _os .O_CREAT | _os .O_EXCL
Original file line number Diff line number Diff line change 2222try :
2323 import threading
2424except ImportError :
25- import _dummy_thread as threading
25+ import dummy_threading as threading
2626import time
2727import contextlib
2828import pathlib
Original file line number Diff line number Diff line change 1+ ../ ../ ../ Lib / _dummy_thread .py
Original file line number Diff line number Diff line change @@ -233,6 +233,8 @@ impl VirtualMachine {
233233 let mut essential_init = || -> PyResult {
234234 #[ cfg( not( target_arch = "wasm32" ) ) ]
235235 import:: import_builtin ( self , "_signal" ) ?;
236+ #[ cfg( not( feature = "threading" ) ) ]
237+ import:: import_frozen ( self , "_thread" ) ?;
236238 let importlib = import:: init_importlib_base ( self ) ?;
237239 self . import_utf8_encodings ( ) ?;
238240
You can’t perform that action at this time.
0 commit comments