# FileNotFoundError is a subclass of OSError, catch that or the exception itself: except OSError as e: