mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
||||
|
|
|
@ -427,6 +427,7 @@ _exitcode_to_name = {}
|
|||
for name, signum in list(signal.__dict__.items()):
|
||||
if name[:3]=='SIG' and '_' not in name:
|
||||
_exitcode_to_name[-signum] = f'-{name}'
|
||||
del name, signum
|
||||
|
||||
# For debug and leak testing
|
||||
_dangling = WeakSet()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue