Handle locals and globals separatly

This commit is contained in:
Daniel A. Wozniak 2019-10-01 09:21:53 +00:00
parent bcbe9a20fd
commit 0bad9cb5d5
No known key found for this signature in database
GPG Key ID: 166B9D2C06C82D61

View File

@ -58,8 +58,10 @@ def purge_pip():
sys.modules.pop(name)
del entry
if 'pip' in globals() or 'pip' in locals():
del pip
if 'pip' in globals():
del globals()['pip']
if 'pip' in locals():
del locals()['pip']
sys_modules_pip = sys.modules.pop('pip', None)
if sys_modules_pip is not None:
del sys_modules_pip