We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 175a718 commit b353ddbCopy full SHA for b353ddb
util/chplenv/utils.py
@@ -26,9 +26,12 @@ def set_buffer_warnings(buffer_warnings):
26
global _buffer_warnings
27
_buffer_warnings = buffer_warnings
28
29
+def should_buffer_warnings():
30
+ return _buffer_warnings and not ignore_errors
31
+
32
def warning(msg):
33
if not os.environ.get('CHPLENV_SUPPRESS_WARNINGS'):
- if _buffer_warnings:
34
+ if should_buffer_warnings():
35
_warning_buffer.append(msg)
36
else:
37
sys.stderr.write('Warning: ')
@@ -50,6 +53,7 @@ def error(msg, exception=Exception):
50
53
sys.stderr.write(''.join(out))
51
54
52
55
# flush warnings, print error, and exit
56
+ # technically, there is no need to flush warnings here, but might as well
57
flush_warnings()
58
59
sys.exit(1)
0 commit comments