I want to implement an exception displayer and it doesn't work, but I have something different:
Traceback (most recent call last):
File "/Users/honzik/PycharmProjects/Toy/test.py", line 21, in main
raise IOError('Foo bar bazooka!')
OSError: Foo bar bazooka!
How can be raised an OSError when I specified IOError?
IOError
is only an alias for OSError
in Python3, see https://docs.python.org/3/library/exceptions.html#concrete-exceptions:
Changed in version 3.3:
EnvironmentError
,IOError
,WindowsError
,VMSError
,socket.error
,select.error
andmmap.error
have been merged intoOSError
, and the constructor may return a subclass.