From a46e0569c2aba4f3d6bf3167ed12f29b5daa52a2 Mon Sep 17 00:00:00 2001 From: adam j hartz Date: Thu, 2 Jun 2016 11:55:45 -0400 Subject: [PATCH] make rc files be run in __xonsh_ctx__ directly --- xonsh/environ.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xonsh/environ.py b/xonsh/environ.py index 6f2e43f3a..faa1e8a28 100644 --- a/xonsh/environ.py +++ b/xonsh/environ.py @@ -1272,12 +1272,15 @@ def load_static_config(ctx, config=None): return conf -def xonshrc_context(rcfiles=None, execer=None): +def xonshrc_context(rcfiles=None, execer=None, initial=None): """Attempts to read in xonshrc file, and return the contents.""" loaded = builtins.__xonsh_env__['LOADED_RC_FILES'] = [] + if initial is None: + env = {} + else: + env = initial if rcfiles is None or execer is None: - return {} - env = {} + return env for rcfile in rcfiles: if not os.path.isfile(rcfile): loaded.append(False)