diff options
| author | Nikita Sobolev <mail@sobolevn.me> | 2022-02-03 09:20:08 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-03 09:20:08 (GMT) |
| commit | 0cbdd2131195b0d313762968f604e80a3e65ca9f (patch) | |
| tree | 3f512c22e4ef6bbfc9d2246ad26446271e0e3ce7 /Lib/multiprocessing/managers.py | |
| parent | 6394e981adaca2c0daa36c8701611e250d74024c (diff) | |
| download | cpython-0cbdd2131195b0d313762968f604e80a3e65ca9f.zip cpython-0cbdd2131195b0d313762968f604e80a3e65ca9f.tar.gz cpython-0cbdd2131195b0d313762968f604e80a3e65ca9f.tar.bz2 | |
bpo-46565: `del` loop vars that are leaking into module namespaces (GH-30993)
Diffstat (limited to 'Lib/multiprocessing/managers.py')
| -rw-r--r-- | Lib/multiprocessing/managers.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index cf637c6..d973819 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -49,11 +49,11 @@ def reduce_array(a): reduction.register(array.array, reduce_array) view_types = [type(getattr({}, name)()) for name in ('items','keys','values')] -if view_types[0] is not list: # only needed in Py3.0 - def rebuild_as_list(obj): - return list, (list(obj),) - for view_type in view_types: - reduction.register(view_type, rebuild_as_list) +def rebuild_as_list(obj): + return list, (list(obj),) +for view_type in view_types: + reduction.register(view_type, rebuild_as_list) +del view_type, view_types # # Type for identifying shared objects |
