some xexec optimizations

This commit is contained in:
Anthony Scopatz 2016-07-26 12:40:20 -04:00
parent 60aafcfb16
commit 85f37ecaa9

View file

@ -282,9 +282,8 @@ def xexec(args, stdin=None):
"""Replaces current process with command specified and passes in the
current xonsh environment.
"""
env = builtins.__xonsh_env__
denv = env.detype()
if len(args) > 0:
denv = builtins.__xonsh_env__.detype()
try:
os.execvpe(args[0], args, denv)
except FileNotFoundError as e: