Merge pull request #35 from bruor/patch-1

add exception handling for isatty()
This commit is contained in:
Matteo ℱan
2019-10-05 22:15:26 +02:00
committed by GitHub

View File

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