Skip to content

Commit

Permalink
replwrap module requires path to *real* pexpect path to find bashrc.sh
Browse files Browse the repository at this point in the history
Thanks to @auneri for finding fix to #144.

This names and exports pexpect's __file__.

Closes #144.
  • Loading branch information
Doug Blank committed Apr 22, 2017
1 parent c4eddf1 commit ebbeb9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metakernel/pexpect.py
Expand Up @@ -2,7 +2,7 @@
from __future__ import absolute_import
import os
import signal
from pexpect import is_executable_file, EOF, TIMEOUT
from pexpect import is_executable_file, EOF, TIMEOUT, __file__ as PEXPECT_DIR

try:
from pexpect import spawn as pty_spawn
Expand Down
2 changes: 1 addition & 1 deletion metakernel/replwrap.py
Expand Up @@ -229,7 +229,7 @@ def bash(command="bash", prompt_regex=re.compile('[$#]')):
extra_init_cmd = "export PAGER=cat"

# Make sure the bash shell has a valid ending character.
bashrc = os.path.join(os.path.dirname(pexpect.__file__), 'bashrc.sh')
bashrc = os.path.join(os.path.dirname(pexpect.PEXPECT_DIR), 'bashrc.sh')
child = pexpect.spawn(command, ['--rcfile', bashrc], echo=False,
encoding='utf-8')

Expand Down

0 comments on commit ebbeb9a

Please sign in to comment.