mirror of
https://github.com/SystemRage/py-kms.git
synced 2025-08-10 12:47:10 +08:00
add execption handling for isatty()
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user