From f5c1ad4f498a1c66c2cc21dc0243cfd438ba7c68 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 13 Oct 2015 17:24:09 +0200 Subject: Fix asyncio issue (3.4.3+) Signed-off-by: Igor Gnatenko --- ...o-listening-to-pty-once-we-ve-found-what-.patch | 41 ++++++++++++++++++++++ pexpect-4.0.1-disable-some-tests.patch | 10 ------ python-pexpect.spec | 7 ++-- 3 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch delete mode 100644 pexpect-4.0.1-disable-some-tests.patch 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 +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 + diff --git a/pexpect-4.0.1-disable-some-tests.patch b/pexpect-4.0.1-disable-some-tests.patch deleted file mode 100644 index a553e30..0000000 --- a/pexpect-4.0.1-disable-some-tests.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/tests/test_async.py b/tests/test_async.py -index ce75572..7bee98f 100644 ---- a/tests/test_async.py -+++ b/tests/test_async.py -@@ -48,4 +48,4 @@ class AsyncTests(PexpectTestCase): - p = pexpect.spawn('%s list100.py' % sys.executable) - assert run(p.expect_exact(b'5', async=True)) == 0 - assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 -- assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 -+ #assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 diff --git a/python-pexpect.spec b/python-pexpect.spec index 76f1a96..68d7210 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,12 +3,12 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} Version: 4.0.1 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz -Patch0: pexpect-4.0.1-disable-some-tests.patch +Patch0: 0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch Patch1: 0001-disable-max-canon-tests-retain-file-contents.patch Patch2: 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch @@ -135,6 +135,9 @@ popd %{python3_sitelib}/%{modname}* %changelog +* Tue Oct 13 2015 Igor Gnatenko - 4.0.1-3 +- Fix asyncio issue (3.4.3+) + * Thu Oct 08 2015 Igor Gnatenko - 4.0.1-2 - Fix RPM macroses -- cgit