mirror of
https://github.com/SystemRage/py-kms.git
synced 2024-10-18 12:28:16 +02:00
Merge pull request #35 from bruor/patch-1
add exception handling for isatty()
This commit is contained in:
commit
e1a95806a8
@ -187,8 +187,11 @@ class ShellMessage(object):
|
|||||||
if sys.stdout.isatty():
|
if sys.stdout.isatty():
|
||||||
print(toprint)
|
print(toprint)
|
||||||
else:
|
else:
|
||||||
from pykms_GuiBase import gui_redirect # Import after variables creation.
|
try:
|
||||||
gui_redirect(toprint)
|
from pykms_GuiBase import gui_redirect # Import after variables creation.
|
||||||
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user