gh-98040: Remove just the imp module (#98573)

This commit is contained in:
Barry Warsaw 2023-04-28 16:17:58 -07:00 committed by GitHub
parent 79b9db9295
commit e1f14643dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 40 additions and 1537 deletions

View file

@ -131,9 +131,8 @@ def uncache(*names):
"""
for name in names:
if name in ('sys', 'marshal', 'imp'):
raise ValueError(
"cannot uncache {0}".format(name))
if name in ('sys', 'marshal'):
raise ValueError("cannot uncache {}".format(name))
try:
del sys.modules[name]
except KeyError: