News for hackers. Stuff that matters.
Re:The Elements of Python Style by teddyh on Monday January 04, 2016 @03:33PM (#10838334)
Note that FileNotFoundError is preferred in modern Python instead of OSError. In case of old Python, one should narrow the catching to cover only the wanted case:

    import os, errno

    try:
        os.remove(temp_file)
    except OSError as e:
        if e.errno != errno.ENOENT:
            raise
Re:The Elements of Python Style by revelation on Monday January 04, 2016 @03:50PM (#10838475)
I can see why this is the preferred idiom.