summaryrefslogtreecommitdiffstats
path: root/python.d
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@tsaousis.gr>2016-11-21 16:33:30 +0200
committerCosta Tsaousis <costa@tsaousis.gr>2016-11-21 16:33:30 +0200
commit9abc4748745b853352502d29094f779e9e134f24 (patch)
treee1454e5a12c9f66859ceb51529be41f33ef0f2d7 /python.d
parent4d7c13e7982b5fb4f8c1a9d4c716050d2cc5be91 (diff)
really exit on fatal situations, even if no output is possible; fixes #1155
Diffstat (limited to 'python.d')
-rw-r--r--python.d/python_modules/msg.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python.d/python_modules/msg.py b/python.d/python_modules/msg.py
index b835c94045..74716770c8 100644
--- a/python.d/python_modules/msg.py
+++ b/python.d/python_modules/msg.py
@@ -93,8 +93,9 @@ def fatal(*args):
"""
Print message on stderr and exit.
"""
- log_msg("FATAL", *args)
- # using sys.stdout causes IOError: Broken Pipe
- print('DISABLE')
- # sys.stdout.write('DISABLE\n')
+ try:
+ log_msg("FATAL", *args)
+ print('DISABLE')
+ except:
+ pass
sys.exit(1)