This repository was archived by the owner on Jan 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 99import sys
1010from xml .etree import ElementTree
1111
12- EXIT_SUCCESS = 0
13- EXIT_FAILURE = - 1
12+ from exitstatus import ExitStatus
1413
1514
1615class CppcheckError (object ):
@@ -144,7 +143,7 @@ def generate_single_success_test_suite():
144143
145144
146145def main (): # pragma: no cover
147- # type: () -> int
146+ # type: () -> ExitStatus
148147 """Main function.
149148
150149 Returns:
@@ -156,22 +155,22 @@ def main(): # pragma: no cover
156155 errors = parse_cppcheck (args .input_file )
157156 except ValueError as e :
158157 print (str (e ))
159- return EXIT_FAILURE
158+ return ExitStatus . failure
160159 except IOError as e :
161160 print (str (e ))
162- return EXIT_FAILURE
161+ return ExitStatus . failure
163162 except ElementTree .ParseError as e :
164163 print ('{} is a malformed XML file. Did you use --xml-version=2?\n {}' .format (
165164 args .input_file , e ))
166- return EXIT_FAILURE
165+ return ExitStatus . failure
167166
168167 if len (errors ) > 0 :
169168 tree = generate_test_suite (errors )
170169 else :
171170 tree = generate_single_success_test_suite ()
172171 tree .write (args .output_file , encoding = 'utf-8' , xml_declaration = True )
173172
174- return EXIT_SUCCESS
173+ return ExitStatus . success
175174
176175if __name__ == '__main__' : # pragma: no cover
177176 sys .exit (main ())
Original file line number Diff line number Diff line change 1+ exitstatus
12typing
You can’t perform that action at this time.
0 commit comments