bpo-30266: support "= None" pattern in AbstractContextManager (GH-1448) (GH-2054)

contextlib.AbstractContextManager now supports anti-registration
by setting __enter__ = None or __exit__ = None, following the pattern
introduced in bpo-25958..
(cherry picked from commit 57161aac5eb9bcb0b43e551a1937ff0a84c1ec52)
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index b1a467d..2301f75 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -44,6 +44,16 @@
 
         self.assertTrue(issubclass(DefaultEnter, AbstractContextManager))
 
+        class NoEnter(ManagerFromScratch):
+            __enter__ = None
+
+        self.assertFalse(issubclass(NoEnter, AbstractContextManager))
+
+        class NoExit(ManagerFromScratch):
+            __exit__ = None
+
+        self.assertFalse(issubclass(NoExit, AbstractContextManager))
+
 
 class ContextManagerTestCase(unittest.TestCase):