summaryrefslogtreecommitdiff
path: root/tests/interact.py
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2015-09-15 17:26:50 -0700
committerJeff Quast <contact@jeffquast.com>2015-09-15 17:26:50 -0700
commit1a8bd9750d7023b32b647677874211b38a3772f6 (patch)
tree3b8821621e229cecf3e13007ae4c0dc0ea7b225f /tests/interact.py
parentcde8e15893edd87c61acf0515fd217554d21ce51 (diff)
downloadpexpect-allow-disable-escape-interact.tar.gz
Allow {p}.interact(escape_character=None)allow-disable-escape-interact
For those who wish to disable the ability to escape using process (likely, human) input until normal process termination, they may now set the value of escape_character to None. Some of the related docstring on escape_character was made more brief and clear about its behaviour.
Diffstat (limited to 'tests/interact.py')
-rwxr-xr-xtests/interact.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/interact.py b/tests/interact.py
index 9f8e672..93b9bea 100755
--- a/tests/interact.py
+++ b/tests/interact.py
@@ -33,7 +33,10 @@ import sys
def main():
p = pexpect.spawn(sys.executable + ' echo_w_prompt.py',
env=no_coverage_env())
- p.interact()
+ escape_character = chr(29) # default matches api
+ if len(sys.argv) > 2 and sys.argv[1] == '--no-escape':
+ escape_character = None
+ p.interact(escape_character=escape_character)
print("Escaped interact")
if __name__ == '__main__':