diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index db98618220..a9b2995e09 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -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