]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Support patchless use of backports_abc 0.4
authorBen Darnell <ben@bendarnell.com>
Wed, 30 Sep 2015 05:05:28 +0000 (01:05 -0400)
committerBen Darnell <ben@bendarnell.com>
Wed, 30 Sep 2015 05:05:28 +0000 (01:05 -0400)
maint/test/cython/cythonapp_test.py
maint/test/cython/tox.ini
tornado/gen.py

index c3312de41da36d6d756b10822d8279d6481eb12f..0af465abb25cace57eb16f4718c89367533f05e7 100644 (file)
@@ -1,10 +1,3 @@
-try:
-    import backports_abc
-except ImportError:
-    raise
-else:
-    backports_abc.patch()
-
 from tornado.testing import AsyncTestCase, gen_test
 from tornado.util import ArgReplacer
 import unittest
index 38949d52fde883bdfa8aad9fda47547309ecf998..8f5b20b1d26cad3d3ea515998f5924a19f528974 100644 (file)
@@ -5,8 +5,8 @@ envlist = py27,py32,py33,py34,py35
 [testenv]
 deps =
      ../../..
-     Cython>= 0.23.1
-     backports_abc
+     Cython>=0.23.3
+     backports_abc>=0.4
      singledispatch
 commands = python -m unittest cythonapp_test
 # Most of these are defaults, but if you specify any you can't fall back
index 10189b8d33f14346dfe02554d7a316081633da75..31521b332e451dbd2b99cbbc48df8f5c840f10b1 100644 (file)
@@ -102,15 +102,18 @@ try:
     from collections.abc import Generator as GeneratorType  # py35+
 except ImportError:
     try:
-        from collections import Generator as GeneratorType  # py2 with backports_abc
+        from backports_abc import Generator as GeneratorType
     except ImportError:
         from types import GeneratorType
 
 try:
     from inspect import isawaitable  # py35+
 except ImportError:
-    def isawaitable(x):
-        return False
+    try:
+        from backports_abc import isawaitable
+    except ImportError:
+        def isawaitable(x):
+            return False
 
 try:
     import builtins  # py3