lazy-object-proxy: FTBFS building against python 3.15

Maximiliano Curia <[email protected]>
Newsgroups gmane.linux.debian.devel.python
Message-ID <[email protected]>
Package: src:lazy-object-proxy
Version: 1.12.0-1
User: [email protected]
Usertags: python3.15
Tags: patch

Hi!

While rebuilding the python related packages against the python version
3.15rc1 we found that lazy-object-proxy fails to build from source [1].

This is due to some changes in the exception messages in 3.15, and the
tests of lazy-object-proxy requiring an exact match.

I'm attaching a patch to fix that, and a fix to a RuntimeWarning as the
coroutine is never closed when an exception is raised (test_await_12).

Please consider including this patch in your next upload and forwarding
the patch upstream.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/work-request/999268/
-- 
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
python3.15-compat.patch (text/x-diff, 1.4 KB)
Description: Fix test failures with Python 3.15
 Loosen the exception match regexes to accept the old and the new formats, and wrap
 test_await_12 in try/finally to ensure the coroutine is always closed even if
 an exception is raised during the test.
Author: Maximiliano Curia <[email protected]>
Forwarded: no
---
--- a/tests/test_async_py3.py
+++ b/tests/test_async_py3.py
@@ -542,7 +542,7 @@
     async def foo():
         return await lop.Proxy(Awaitable)

-    with pytest.raises(TypeError, match='__await__.*returned non-iterator of type'):
+    with pytest.raises(TypeError, match=r'__await__.*(returned non-iterator of type|must return an iterator)'):
         run_async(lop.Proxy(foo))


@@ -650,10 +650,11 @@
     async def foo():
         return await lop.Proxy(Awaitable)

-    with pytest.raises(TypeError, match=r'__await__\(\) returned a coroutine'):
-        run_async(lop.Proxy(foo))
-
-    c.close()
+    try:
+        with pytest.raises(TypeError, match=r'__await__.*(returned a coroutine|must return an iterator, not coroutine)'):
+            run_async(lop.Proxy(foo))
+    finally:
+        c.close()


 def test_await_13(lop):
@@ -664,7 +665,7 @@
     async def foo():
         return await lop.Proxy(Awaitable)

-    with pytest.raises(TypeError, match='__await__.*returned non-iterator of type'):
+    with pytest.raises(TypeError, match=r'__await__.*(returned non-iterator of type|must return an iterator)'):
         run_async(lop.Proxy(foo))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.