Why manually writing into stderr suppress other exceptions' error massage in python?

65 Views Asked by At

I figured out that after I try to manually write something into the stderr file, no error message will be appear in the shell.

>>> f = open(2, 'w')
>>> f.write('hello\n')
hello
6
>>> f.close()
>>> raise Exception
>>> 
>>> 
>>> 1/0
>>> 

Why it happens?

0

There are 0 best solutions below