deinit() doesn't work if init() was called twice. #145
Open
Description
>>> import colorama
>>> import sys
>>> id(sys.stdout)
2198406407512
>>> colorama.init()
>>> id(sys.stdout)
2198419631912
>>> colorama.deinit()
>>> id(sys.stdout) # back to the original, as expected
2198406407512
>>> colorama.init()
>>> colorama.init()
>>> colorama.deinit()
>>> id(sys.stdout) # What?
2198419494224
I think init()
should probably either raise an error, or no-op if colorama was already initialized.
But in any case, it should not break deinit
by losing the original stdout
/stderr
.