mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-46565: del loop vars that are leaking into module namespaces (GH-30993)
This commit is contained in:
parent
6394e981ad
commit
0cbdd21311
14 changed files with 21 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue