This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xdegaye
Recipients xdegaye
Date 2018-05-10.20:27:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525984057.77.0.682650639539.issue33458@psf.upfronthosting.co.za>
In-reply-to
Content
This issue is a companion to issue 13044.

Running with Python 3.6.5 the following code fails with NameError:

1 class C:
2     def __del__(self):
3         print('deleted')
4
5 c = C()
6 x = 1

$  python -m pdb bar.py
> ./bar.py(1)<module>()
-> class C:
(Pdb) break 6
Breakpoint 1 at ./bar.py:6
(Pdb) continue
> ./bar.py(6)<module>()
-> x = 1
(Pdb) step
--Return--
> ./bar.py(6)<module>()->None
-> x = 1
(Pdb) step
--Return--
> <string>(1)<module>()->None
(Pdb) step
> /usr/lib/python3.6/bdb.py(438)run()
-> self.quitting = True
(Pdb) step
The program finished and will be restarted
Exception ignored in: <bound method C.__del__ of <__main__.C object at 0x7f3fb3485b70>>
Traceback (most recent call last):
  File "./bar.py", line 3, in __del__
    print('deleted')
NameError: name 'print' is not defined
> ./bar.py(1)<module>()
-> class C:
(Pdb)
History
Date User Action Args
2018-05-10 20:27:37xdegayesetrecipients: + xdegaye
2018-05-10 20:27:37xdegayesetmessageid: <1525984057.77.0.682650639539.issue33458@psf.upfronthosting.co.za>
2018-05-10 20:27:37xdegayelinkissue33458 messages
2018-05-10 20:27:37xdegayecreate