Fix colorama log issues on Windows when frozen.
With the new version of colorlog, colorama.init() gets called when opening colorlog, which then lead to sys.stderr not being None anymore (but a wrapped "None"), which lead to an exception when we checked isatty(). We now just unwrap these again.
This commit is contained in:
parent
d2b7530c0a
commit
012482ce10
@ -36,6 +36,11 @@ try:
|
|||||||
from colorlog import ColoredFormatter
|
from colorlog import ColoredFormatter
|
||||||
except ImportError:
|
except ImportError:
|
||||||
ColoredFormatter = None
|
ColoredFormatter = None
|
||||||
|
else:
|
||||||
|
# colorlog calls colorama.init() which breaks our sys.stdout/sys.stderr if
|
||||||
|
# they are None.
|
||||||
|
sys.stderr = sys.__stderr__
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
try:
|
try:
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
import colorama
|
import colorama
|
||||||
|
Loading…
Reference in New Issue
Block a user