[Python-checkins] cpython (merge 3.6 -> default): Merge 3.6 (issue #27243)

yury.selivanov python-checkins at python.org
Tue Nov 8 15:15:47 EST 2016


https://hg.python.org/cpython/rev/9550f0d22d27
changeset:   104983:9550f0d22d27
parent:      104981:4ca9a4f96edc
parent:      104982:a0d50aad7b02
user:        Yury Selivanov <yury at magic.io>
date:        Tue Nov 08 15:15:42 2016 -0500
summary:
  Merge 3.6 (issue #27243)

files:
  Lib/test/test_coroutines.py |  18 +++++++++---------
  Python/ceval.c              |   2 +-
  2 files changed, 10 insertions(+), 10 deletions(-)


diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -1398,7 +1398,7 @@
 
         buffer = []
         async def test1():
-            with self.assertWarnsRegex(PendingDeprecationWarning, "legacy"):
+            with self.assertWarnsRegex(DeprecationWarning, "legacy"):
                 async for i1, i2 in AsyncIter():
                     buffer.append(i1 + i2)
 
@@ -1412,7 +1412,7 @@
         buffer = []
         async def test2():
             nonlocal buffer
-            with self.assertWarnsRegex(PendingDeprecationWarning, "legacy"):
+            with self.assertWarnsRegex(DeprecationWarning, "legacy"):
                 async for i in AsyncIter():
                     buffer.append(i[0])
                     if i[0] == 20:
@@ -1431,7 +1431,7 @@
         buffer = []
         async def test3():
             nonlocal buffer
-            with self.assertWarnsRegex(PendingDeprecationWarning, "legacy"):
+            with self.assertWarnsRegex(DeprecationWarning, "legacy"):
                 async for i in AsyncIter():
                     if i[0] > 20:
                         continue
@@ -1514,7 +1514,7 @@
                 return 123
 
         async def foo():
-            with self.assertWarnsRegex(PendingDeprecationWarning, "legacy"):
+            with self.assertWarnsRegex(DeprecationWarning, "legacy"):
                 async for i in I():
                     print('never going to happen')
 
@@ -1623,7 +1623,7 @@
                 1/0
         async def foo():
             nonlocal CNT
-            with self.assertWarnsRegex(PendingDeprecationWarning, "legacy"):
+            with self.assertWarnsRegex(DeprecationWarning, "legacy"):
                 async for i in AI():
                     CNT += 1
             CNT += 10
@@ -1650,7 +1650,7 @@
         self.assertEqual(CNT, 0)
 
     def test_for_9(self):
-        # Test that PendingDeprecationWarning can safely be converted into
+        # Test that DeprecationWarning can safely be converted into
         # an exception (__aiter__ should not have a chance to raise
         # a ZeroDivisionError.)
         class AI:
@@ -1660,13 +1660,13 @@
             async for i in AI():
                 pass
 
-        with self.assertRaises(PendingDeprecationWarning):
+        with self.assertRaises(DeprecationWarning):
             with warnings.catch_warnings():
                 warnings.simplefilter("error")
                 run_async(foo())
 
     def test_for_10(self):
-        # Test that PendingDeprecationWarning can safely be converted into
+        # Test that DeprecationWarning can safely be converted into
         # an exception.
         class AI:
             async def __aiter__(self):
@@ -1675,7 +1675,7 @@
             async for i in AI():
                 pass
 
-        with self.assertRaises(PendingDeprecationWarning):
+        with self.assertRaises(DeprecationWarning):
             with warnings.catch_warnings():
                 warnings.simplefilter("error")
                 run_async(foo())
diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1917,7 +1917,7 @@
                 Py_DECREF(iter);
 
                 if (PyErr_WarnFormat(
-                        PyExc_PendingDeprecationWarning, 1,
+                        PyExc_DeprecationWarning, 1,
                         "'%.100s' implements legacy __aiter__ protocol; "
                         "__aiter__ should return an asynchronous "
                         "iterator, not awaitable",

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list