Skip to content

Commit

Permalink
bpo-36597: fix weakref example code (pythonGH-12779)
Browse files Browse the repository at this point in the history
Commit 57b1a28 fixed doctest, but example code is not
match with document.
Just skip doctest for the block.
  • Loading branch information
methane authored Apr 11, 2019
1 parent 2b00db6 commit b3c92c6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Doc/library/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
<finalize object at ...; for 'Object' at ...>
>>> del obj
obj dead or exiting
.. doctest::
:options: +SKIP

>>> obj = Object()
>>> weakref.finalize(obj, print, "obj dead or exiting")
<finalize object at ...; for 'Object' at ...>
>>> exit()
obj dead or exiting


Comparing finalizers with :meth:`__del__` methods
Expand Down

0 comments on commit b3c92c6

Please sign in to comment.