.. _not-context-manager: not-context-manager / E1129 =========================== **Message emitted:** ``Context manager '%s' doesn't implement __enter__ and __exit__.`` **Description:** *Used when an instance in a with statement doesn't implement the context manager protocol(__enter__/__exit__).* **Problematic code:** .. literalinclude:: /data/messages/n/not-context-manager/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/n/not-context-manager/good.py :language: python Created by the `typecheck `__ checker.