summaryrefslogtreecommitdiffstats
path: root/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch
diff options
context:
space:
mode:
authorIgor Gnatenko <ignatenkobrain@fedoraproject.org>2015-10-13 17:24:09 +0200
committerIgor Gnatenko <ignatenkobrain@fedoraproject.org>2015-10-13 17:24:09 +0200
commitf5c1ad4f498a1c66c2cc21dc0243cfd438ba7c68 (patch)
tree2bd2e55d1df8ebecf5f1961883592fc7b2ac5a97 /0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch
parente4689f3eb1462d537486131ed9fbecd200f61063 (diff)
downloadpython-pexpect-f5c1ad4f498a1c66c2cc21dc0243cfd438ba7c68.tar.gz
python-pexpect-f5c1ad4f498a1c66c2cc21dc0243cfd438ba7c68.tar.xz
python-pexpect-f5c1ad4f498a1c66c2cc21dc0243cfd438ba7c68.zip
Fix asyncio issue (3.4.3+)
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Diffstat (limited to '0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch')
-rw-r--r--0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch b/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch
new file mode 100644
index 0000000..b84b4ce
--- /dev/null
+++ b/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch
@@ -0,0 +1,41 @@
+From 5e6e0ad21acfed32c57ae8ef23a8a0722869afe1 Mon Sep 17 00:00:00 2001
+From: Thomas Kluyver <takowl@gmail.com>
+Date: Tue, 13 Oct 2015 12:41:09 +0100
+Subject: [PATCH] Stop asyncio listening to pty once we've found what we need
+
+Closes gh-213 (fingers crossed)
+---
+ pexpect/async.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/pexpect/async.py b/pexpect/async.py
+index a798457..136fc0e 100644
+--- a/pexpect/async.py
++++ b/pexpect/async.py
+@@ -23,6 +23,7 @@ def expect_async(expecter, timeout=None):
+ return expecter.timeout(e)
+
+ class PatternWaiter(asyncio.Protocol):
++ transport = None
+ def __init__(self, expecter):
+ self.expecter = expecter
+ self.fut = asyncio.Future()
+@@ -30,10 +31,15 @@ class PatternWaiter(asyncio.Protocol):
+ def found(self, result):
+ if not self.fut.done():
+ self.fut.set_result(result)
++ self.transport.pause_reading()
+
+ def error(self, exc):
+ if not self.fut.done():
+ self.fut.set_exception(exc)
++ self.transport.pause_reading()
++
++ def connection_made(self, transport):
++ self.transport = transport
+
+ def data_received(self, data):
+ spawn = self.expecter.spawn
+--
+2.6.1
+