mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
vox: Fix virtual environment removal
Virtual environment was impossible to delete after activation/deactivation cycle.
This commit is contained in:
parent
88645cbce4
commit
f4794caef7
2 changed files with 7 additions and 1 deletions
|
@ -214,6 +214,9 @@ class VoxHandler:
|
|||
file=sys.stderr,
|
||||
)
|
||||
return
|
||||
except KeyError:
|
||||
print('"%s" environment doesn\'t exist.\n' % name, file=sys.stderr)
|
||||
return
|
||||
else:
|
||||
print('Environment "%s" removed.' % name)
|
||||
print()
|
||||
|
|
|
@ -272,7 +272,10 @@ class Vox(collections.abc.Mapping):
|
|||
the current one (throws a KeyError if there isn't one).
|
||||
"""
|
||||
if name is ...:
|
||||
env_paths = [builtins.__xonsh__.env["VIRTUAL_ENV"]]
|
||||
env = builtins.__xonsh__.env
|
||||
if not env["VIRTUAL_ENV"]:
|
||||
raise KeyError()
|
||||
env_paths = [env["VIRTUAL_ENV"]]
|
||||
elif isinstance(name, PathLike):
|
||||
env_paths = [fspath(name)]
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue