Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pexpect for openSUSE:Factory 
checked in at 2023-01-07 17:17:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pexpect (Old)
 and      /work/SRC/openSUSE:Factory/.python-pexpect.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pexpect"

Sat Jan  7 17:17:39 2023 rev:36 rq:1056699 version:4.8.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pexpect/python-pexpect.changes    
2022-11-10 14:19:19.397351255 +0100
+++ /work/SRC/openSUSE:Factory/.python-pexpect.new.1563/python-pexpect.changes  
2023-01-07 17:19:27.270062933 +0100
@@ -1,0 +2,5 @@
+Fri Jan  6 20:51:12 UTC 2023 - Dirk Müller <[email protected]>
+
+- add 684.patch, 715.patch: Python 3.11 support 
+
+-------------------------------------------------------------------

New:
----
  684.patch
  715.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pexpect.spec ++++++
--- /var/tmp/diff_new_pack.lw1BCJ/_old  2023-01-07 17:19:27.738065725 +0100
+++ /var/tmp/diff_new_pack.lw1BCJ/_new  2023-01-07 17:19:27.742065749 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pexpect
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,9 @@
 URL:            https://pexpect.readthedocs.org/en/latest/
 Source:         
https://files.pythonhosted.org/packages/source/p/pexpect/pexpect-%{version}.tar.gz
 Patch0:         no-python-binary.patch
+# Newer asyncio / python 3.11 support
+Patch1:         https://github.com/pexpect/pexpect/pull/715.patch
+Patch2:         https://github.com/pexpect/pexpect/pull/684.patch
 BuildRequires:  %{python_module ptyprocess}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
@@ -45,8 +48,7 @@
 controlling them; and responding to expected patterns in their output.
 
 %prep
-%setup -q -n pexpect-%{version}
-%patch0 -p1
+%autosetup -p1 -n pexpect-%{version}
 
 # Fix wrong-script-interpreter
 find examples -type f -name "*.py" -exec sed -i "s|#!%{_bindir}/env python||" 
{} \;

++++++ 684.patch ++++++
>From 0bc643ea88748e08a095e3f1a43480c9113d45b8 Mon Sep 17 00:00:00 2001
From: Karthikeyan Singaravelan <[email protected]>
Date: Sat, 17 Apr 2021 08:10:37 +0000
Subject: [PATCH] Set daemon attribute instead of using setDaemon method that
 was deprecated in Python 3.10

---
 pexpect/popen_spawn.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pexpect/popen_spawn.py b/pexpect/popen_spawn.py
index 4bb58cfe..e6bdf07d 100644
--- a/pexpect/popen_spawn.py
+++ b/pexpect/popen_spawn.py
@@ -57,7 +57,7 @@ def __init__(self, cmd, timeout=30, maxread=2000, 
searchwindowsize=None,
 
         self._read_queue = Queue()
         self._read_thread = threading.Thread(target=self._read_incoming)
-        self._read_thread.setDaemon(True)
+        self._read_thread.daemon = True
         self._read_thread.start()
 
     _read_reached_eof = False

++++++ 715.patch ++++++
>From 52af5b0ae0627139524448a3f2e83d9f40802bc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <[email protected]>
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
 
[email protected]
-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)
 
[email protected]
-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])
 

Reply via email to