forked from pool/python-celery
Accepting request 677998 from home:jayvdb:branches:devel:languages:python
- Replace no-async.patch with three Python 3.7 patches merged upstream python37-1.patch, python37-2.patch & python37-3.patch - Replace sed invocation with unpin-pytest.patch for clarity OBS-URL: https://build.opensuse.org/request/show/677998 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-celery?expand=0&rev=114
This commit is contained in:
committed by
Git OBS Bridge
parent
27b13e8829
commit
270b7c6b0e
28
python37-3.patch
Normal file
28
python37-3.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 6ab775eb6b5643311af21557fa84d10ce605eb17 Mon Sep 17 00:00:00 2001
|
||||
From: Omer Katz <omer.drow@gmail.com>
|
||||
Date: Fri, 4 Jan 2019 07:12:10 +0200
|
||||
Subject: [PATCH] Avoid raising StopIterator in generators. (#5263)
|
||||
|
||||
According to [PEP-479](https://www.python.org/dev/peps/pep-0479/) StopIteration should not be used any more to indicate the termination of a generator.
|
||||
Starting from Python 3.7 this behaviour is always enforced and a RuntimeError is raised instead.
|
||||
Instead of raising a StopIterator exception, we now never execute our yield statement.
|
||||
Since it is present Gen is still a generator but it will never yield any value.
|
||||
---
|
||||
t/unit/worker/test_loops.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/t/unit/worker/test_loops.py b/t/unit/worker/test_loops.py
|
||||
index f86f730f16..d57b416e47 100644
|
||||
--- a/t/unit/worker/test_loops.py
|
||||
+++ b/t/unit/worker/test_loops.py
|
||||
@@ -383,8 +383,8 @@ def test_poll_write_generator_stopped(self):
|
||||
x = X(self.app)
|
||||
|
||||
def Gen():
|
||||
- raise StopIteration()
|
||||
- yield
|
||||
+ if 0:
|
||||
+ yield
|
||||
gen = Gen()
|
||||
x.hub.add_writer(6, gen)
|
||||
x.hub.on_tick.add(x.close_then_error(Mock(name='tick'), 2))
|
||||
Reference in New Issue
Block a user