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 ncoghlan
Recipients eric.smith, miss-islington, ncoghlan, serhiy.storchaka, vstinner
Date 2018-07-11.15:03:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531321421.82.0.56676864532.issue34067@psf.upfronthosting.co.za>
In-reply-to
Content
Right, the merged PR adds a simpler example that handles "ignore exceptions or not" by selecting between suppress() and nullcontext().

The documentation still needs updating to improve or remove the file-based example, and point out that for resources that get acquired on construction, you either need to delay construction to the start of the with statement, or else use ExitStack instead of nullcontext.
History
Date User Action Args
2018-07-11 15:03:41ncoghlansetrecipients: + ncoghlan, vstinner, eric.smith, serhiy.storchaka, miss-islington
2018-07-11 15:03:41ncoghlansetmessageid: <1531321421.82.0.56676864532.issue34067@psf.upfronthosting.co.za>
2018-07-11 15:03:41ncoghlanlinkissue34067 messages
2018-07-11 15:03:41ncoghlancreate