Abhilash Raj pushed to branch 495-add-python-3-7-to-the-ci at GNU Mailman / 
Mailman Core


Commits:
2dd2dc7e by Abhilash Raj at 2018-07-15T01:22:25Z
PEP 479 changes the way StopIteration is handled inside a generator.

In Python 3.7, StopIteration is changed to RuntimeError, if they are raised in a
generator. This behavior can be implemented in previous versions of Python by
using a __future__ import.

- - - - -


1 changed file:

- src/mailman/testing/mta.py


Changes:

=====================================
src/mailman/testing/mta.py
=====================================
@@ -16,6 +16,7 @@
 # GNU Mailman.  If not, see <http://www.gnu.org/licenses/>.
 
 """Fake MTA for testing purposes."""
+from __future__ import generator_stop
 
 import asyncio
 import smtplib
@@ -209,7 +210,7 @@ class ConnectionCountingController(Controller):
             try:
                 yield self._msg_queue.get_nowait()
             except Empty:
-                raise StopIteration
+                return
 
     @property
     def messages(self):



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/2dd2dc7ed2dfabbac029d3ec830004ff25c32340

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/2dd2dc7ed2dfabbac029d3ec830004ff25c32340
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to