prevent IOError on msg.fatal
paulfantom committed
Aug 14, 2016 at 12:17 UTC
6e6e892832542b88a7d82c7483d686a7aaf0de0e
1 file changed
+3
-1
python.d/python_modules/msg.py
+3
-1
@@ -47,5 +47,7 @@ def fatal(*args):
47
Print message on stderr and exit.
48
"""
49
log_msg("FATAL", *args)
50
- sys.stdout.write('DISABLE\n')
50
+ # using sys.stdout causes IOError: Broken Pipe
51
+ print('DISABLE\n')
52
+ # sys.stdout.write('DISABLE\n')
53
sys.exit(1)
\ No newline at end of file