File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,12 @@ def set_buffer_warnings(buffer_warnings):
26
26
global _buffer_warnings
27
27
_buffer_warnings = buffer_warnings
28
28
29
+ def should_buffer_warnings ():
30
+ return _buffer_warnings and not ignore_errors
31
+
29
32
def warning (msg ):
30
33
if not os .environ .get ('CHPLENV_SUPPRESS_WARNINGS' ):
31
- if _buffer_warnings :
34
+ if should_buffer_warnings () :
32
35
_warning_buffer .append (msg )
33
36
else :
34
37
sys .stderr .write ('Warning: ' )
@@ -50,6 +53,7 @@ def error(msg, exception=Exception):
50
53
sys .stderr .write ('' .join (out ))
51
54
else :
52
55
# flush warnings, print error, and exit
56
+ # technically, there is no need to flush warnings here, but might as well
53
57
flush_warnings ()
54
58
sys .stderr .write ('' .join (out ))
55
59
sys .exit (1 )
You can’t perform that action at this time.
0 commit comments