From 3654edc5455798e4a02ca732c20e1ca7388fb436 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 11 Apr 2019 18:28:24 +0900 Subject: [PATCH 1/2] bpo-36597: fix weakref example code Commit 57b1a2862 fixed doctest, but example code is not match with document. Just skip the doctest. --- Doc/library/weakref.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst index b9e887cab5d158..5e513d32d136a5 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 From 935b589915c93f52a27eaaa56ecc2ef7ee6d719d Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 11 Apr 2019 18:58:47 +0900 Subject: [PATCH 2/2] fix doctest directive --- Doc/library/weakref.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst index 5e513d32d136a5..7f3d267d74c2ec 100644 --- a/Doc/library/weakref.rst +++ b/Doc/library/weakref.rst @@ -489,14 +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 - .. doctest:: - :options: +SKIP - - >>> obj = Object() - >>> weakref.finalize(obj, print, "obj dead or exiting") - - >>> exit() - 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