Author serhiy.storchaka
Recipients jaraco, ncoghlan, rhettinger, serhiy.storchaka
Date 2018-03-27.07:18:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522135081.12.0.467229070634.issue33146@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure that contextlib.suppress() should be added at first place.

    try:
        os.remove(somefile)
    except FileNotFoundError:
        pass

is a tiny bit longer, but is more explicit, doesn't depend on the other module, works in all Python versions that have this exception, and is easily extensible.

    try:
        os.remove(somefile)
    except FileNotFoundError as e:
        # what do you want to do with e?
        pass
History
Date User Action Args
2018-03-27 07:18:01serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, jaraco, ncoghlan
2018-03-27 07:18:01serhiy.storchakasetmessageid: <1522135081.12.0.467229070634.issue33146@psf.upfronthosting.co.za>
2018-03-27 07:18:01serhiy.storchakalinkissue33146 messages
2018-03-27 07:18:01serhiy.storchakacreate