Guido van Rossum <guido <at> python.org> writes: > > OTOH the is a much larger category of false positives, where a close() > call raise an exception for some spurious reason (see the quoted > comment) but no harm is done; in the past the tracebacks printed for > __del__ by default have caused nothing but confuse users (who think > something is seriously wrong but have no way to debug it). > > The svn history of those lines may have more pointers. Well this code dates back to the first checkin in the py3k branch. Apparently the old p3yk branch is not there anymore... I understand the missing globals on shutdown problem, but the error may also be a legitimate programming error, where a close() implementation fails for whatever reason. At least displaying the error may encourage the programmer to strengthen his implementation. How about the following compromise: try: closed = self.closed except: # Object is in an unusable state, don't attempt anything pass else: if not closed: self.close() Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4