From: Inada Naoki Date: Thu, 11 Apr 2019 10:05:32 +0000 (+0900) Subject: bpo-36597: fix weakref example code (GH-12779) X-Git-Tag: v3.8.0a4~217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3c92c6ae923ffb2b9ac5f80b28ecd689de48662;p=python bpo-36597: fix weakref example code (GH-12779) Commit 57b1a2862 fixed doctest, but example code is not match with document. Just skip doctest for the block. --- diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst index b9e887cab5..7f3d267d74 100644 --- a/Doc/library/weakref.rst +++ b/Doc/library/weakref.rst @@ -489,11 +489,14 @@ Unless you set the :attr:`~finalize.atexit` attribute to :const:`False`, a finalizer will be called when the program exits if it is still alive. For instance - >>> obj = Object() - >>> weakref.finalize(obj, print, "obj dead or exiting") #doctest:+ELLIPSIS - - >>> del obj - obj dead or exiting +.. doctest:: + :options: +SKIP + + >>> obj = Object() + >>> weakref.finalize(obj, print, "obj dead or exiting") + + >>> exit() + obj dead or exiting Comparing finalizers with :meth:`__del__` methods