From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1394552-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 2DCDF158090
	for <garchives@archives.gentoo.org>; Mon,  9 May 2022 20:38:22 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 643B6E0878;
	Mon,  9 May 2022 20:38:21 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 466C6E0878
	for <gentoo-commits@lists.gentoo.org>; Mon,  9 May 2022 20:38:21 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 6047C3413F4
	for <gentoo-commits@lists.gentoo.org>; Mon,  9 May 2022 20:38:20 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 8B135475
	for <gentoo-commits@lists.gentoo.org>; Mon,  9 May 2022 20:38:16 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1652128447.c2d15a210f6ce13cd4673222bad4d365da6dcdad.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pexpect/, dev-python/pexpect/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-python/pexpect/files/pexpect-4.8.0-py311.patch dev-python/pexpect/pexpect-4.8.0-r3.ebuild
X-VCS-Directories: dev-python/pexpect/ dev-python/pexpect/files/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: c2d15a210f6ce13cd4673222bad4d365da6dcdad
X-VCS-Branch: master
Date: Mon,  9 May 2022 20:38:16 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 8d098eb3-4138-4f69-985d-b06d6241ccc8
X-Archives-Hash: 10d99988b69f606bddc7409789ab4851

commit:     c2d15a210f6ce13cd4673222bad4d365da6dcdad
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon May  9 18:12:34 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon May  9 20:34:07 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2d15a21

dev-python/pexpect: Enable py3.11

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pexpect/files/pexpect-4.8.0-py311.patch | 67 ++++++++++++++++++++++
 dev-python/pexpect/pexpect-4.8.0-r3.ebuild         |  3 +-
 2 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/dev-python/pexpect/files/pexpect-4.8.0-py311.patch b/dev-python/pexpect/files/pexpect-4.8.0-py311.patch
new file mode 100644
index 000000000000..b7de17a68785
--- /dev/null
+++ b/dev-python/pexpect/files/pexpect-4.8.0-py311.patch
@@ -0,0 +1,67 @@
+From 52af5b0ae0627139524448a3f2e83d9f40802bc2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Thu, 24 Mar 2022 15:15:33 +0100
+Subject: [PATCH] Convert @asyncio.coroutine to async def
+
+This is required for Python 3.11+ support.
+
+Fixes https://github.com/pexpect/pexpect/issues/677
+---
+ pexpect/_async.py | 16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/pexpect/_async.py b/pexpect/_async.py
+index dfbfeef5..bc83261d 100644
+--- a/pexpect/_async.py
++++ b/pexpect/_async.py
+@@ -4,8 +4,7 @@
+ 
+ from pexpect import EOF
+ 
+-@asyncio.coroutine
+-def expect_async(expecter, timeout=None):
++async def expect_async(expecter, timeout=None):
+     # First process data that was previously read - if it maches, we don't need
+     # async stuff.
+     idx = expecter.existing_data()
+@@ -14,7 +13,7 @@ def expect_async(expecter, timeout=None):
+     if not expecter.spawn.async_pw_transport:
+         pw = PatternWaiter()
+         pw.set_expecter(expecter)
+-        transport, pw = yield from asyncio.get_event_loop()\
++        transport, pw = await asyncio.get_event_loop()\
+             .connect_read_pipe(lambda: pw, expecter.spawn)
+         expecter.spawn.async_pw_transport = pw, transport
+     else:
+@@ -22,26 +21,25 @@ def expect_async(expecter, timeout=None):
+         pw.set_expecter(expecter)
+         transport.resume_reading()
+     try:
+-        return (yield from asyncio.wait_for(pw.fut, timeout))
++        return (await asyncio.wait_for(pw.fut, timeout))
+     except asyncio.TimeoutError as e:
+         transport.pause_reading()
+         return expecter.timeout(e)
+ 
+-@asyncio.coroutine
+-def repl_run_command_async(repl, cmdlines, timeout=-1):
++async def repl_run_command_async(repl, cmdlines, timeout=-1):
+     res = []
+     repl.child.sendline(cmdlines[0])
+     for line in cmdlines[1:]:
+-        yield from repl._expect_prompt(timeout=timeout, async_=True)
++        await repl._expect_prompt(timeout=timeout, async_=True)
+         res.append(repl.child.before)
+         repl.child.sendline(line)
+ 
+     # Command was fully submitted, now wait for the next prompt
+-    prompt_idx = yield from repl._expect_prompt(timeout=timeout, async_=True)
++    prompt_idx = await repl._expect_prompt(timeout=timeout, async_=True)
+     if prompt_idx == 1:
+         # We got the continuation prompt - command was incomplete
+         repl.child.kill(signal.SIGINT)
+-        yield from repl._expect_prompt(timeout=1, async_=True)
++        await repl._expect_prompt(timeout=1, async_=True)
+         raise ValueError("Continuation prompt found - input was incomplete:")
+     return u''.join(res + [repl.child.before])
+ 

diff --git a/dev-python/pexpect/pexpect-4.8.0-r3.ebuild b/dev-python/pexpect/pexpect-4.8.0-r3.ebuild
index 22046e4dcd82..67a37a70dcc5 100644
--- a/dev-python/pexpect/pexpect-4.8.0-r3.ebuild
+++ b/dev-python/pexpect/pexpect-4.8.0-r3.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
 PYTHON_REQ_USE="threads(+)"
 
 inherit distutils-r1
@@ -29,6 +29,7 @@ RDEPEND="
 PATCHES=(
 	"${FILESDIR}"/${P}-sphinx-3.patch
 	"${FILESDIR}"/${P}-fix-PS1.patch
+	"${FILESDIR}"/${P}-py311.patch
 )
 
 distutils_enable_tests pytest