add execption handling for isatty()

This commit is contained in:
bruor
2019-06-04 10:23:54 -04:00
committed by GitHub
parent c9465674a5
commit cf1d6a55a3

View File

@@ -187,8 +187,11 @@ class ShellMessage(object):
if sys.stdout.isatty():
print(toprint)
else:
try:
from pykms_GuiBase import gui_redirect # Import after variables creation.
gui_redirect(toprint)
except:
print(toprint)
def spawn(self):
# Save everything that would otherwise go to stdout.