Search found 1 match
- Mon Jan 18, 2021 6:00 am
- Forum: General Discussion and Questions
- Topic: Any OSError Codes as of now?
- Replies: 4
- Views: 7508
Re: Any OSError Codes as of now?
I want to handle specific OSError codes like this: try: os.scandir() except OSPermissionError as error: # Only catch errno.EACCES, errno.EPERM handle_permission_error() except OSFileNotFoundError as error: # Only catch errno.ENOENT handle_FileNotFoundError_error() Can this be done in python? shareit...