Unverified Kaydet (Commit) 4666ec59 authored tarafından INADA Naoki's avatar INADA Naoki Kaydeden (comit) GitHub

bpo-32596: Make lazy-load portable (GH-5316)

Global variables should not used as import target.
Use temporary variable instead.
üst 2fc98ae1
......@@ -40,11 +40,13 @@ def __getattr__(name):
global ProcessPoolExecutor, ThreadPoolExecutor
if name == 'ProcessPoolExecutor':
from .process import ProcessPoolExecutor
return ProcessPoolExecutor
from .process import ProcessPoolExecutor as pe
ProcessPoolExecutor = pe
return pe
if name == 'ThreadPoolExecutor':
from .thread import ThreadPoolExecutor
return ThreadPoolExecutor
from .thread import ThreadPoolExecutor as te
ThreadPoolExecutor = te
return te
raise AttributeError(f"module {__name__} has no attribute {name}")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment