mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-05-30 15:05:20 -04:00
Merge pull request #35 from bruor/patch-1
add exception handling for isatty()
This commit is contained in:
commit
e1a95806a8
1 changed files with 5 additions and 2 deletions
|
@ -187,8 +187,11 @@ class ShellMessage(object):
|
|||
if sys.stdout.isatty():
|
||||
print(toprint)
|
||||
else:
|
||||
from pykms_GuiBase import gui_redirect # Import after variables creation.
|
||||
gui_redirect(toprint)
|
||||
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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue