Skip to content

Commit

Permalink
Handle locals and globals separatly
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Oct 1, 2019
1 parent bcbe9a2 commit 0bad9cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions salt/states/pip_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0bad9cb

Please sign in to comment.