Skip to content

Commit b3c92c6

Browse files
authored
bpo-36597: fix weakref example code (GH-12779)
Commit 57b1a28 fixed doctest, but example code is not match with document. Just skip doctest for the block.
1 parent 2b00db6 commit b3c92c6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Doc/library/weakref.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,14 @@ Unless you set the :attr:`~finalize.atexit` attribute to
489489
:const:`False`, a finalizer will be called when the program exits if it
490490
is still alive. For instance
491491

492-
>>> obj = Object()
493-
>>> weakref.finalize(obj, print, "obj dead or exiting") #doctest:+ELLIPSIS
494-
<finalize object at ...; for 'Object' at ...>
495-
>>> del obj
496-
obj dead or exiting
492+
.. doctest::
493+
:options: +SKIP
494+
495+
>>> obj = Object()
496+
>>> weakref.finalize(obj, print, "obj dead or exiting")
497+
<finalize object at ...; for 'Object' at ...>
498+
>>> exit()
499+
obj dead or exiting
497500

498501

499502
Comparing finalizers with :meth:`__del__` methods

0 commit comments

Comments
 (0)