make rc files be run in __xonsh_ctx__ directly

This commit is contained in:
adam j hartz 2016-06-02 11:55:45 -04:00
parent 2db0912c9b
commit a46e0569c2

View file

@ -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 rcfiles is None or execer is None:
return {}
if initial is None:
env = {}
else:
env = initial
if rcfiles is None or execer is None:
return env
for rcfile in rcfiles:
if not os.path.isfile(rcfile):
loaded.append(False)