Title: [159672] trunk/Tools
- Revision
- 159672
- Author
- [email protected]
- Date
- 2013-11-21 19:49:50 -0800 (Thu, 21 Nov 2013)
Log Message
In filereader.py, process_file() should throw instead of exiting directly when the file doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=124717
Patch by Dániel Bátyai <[email protected]> on 2013-11-21
Reviewed by Ryosuke Niwa.
* Scripts/webkitpy/style/filereader.py:
(TextFileReader.process_file):
* Scripts/webkitpy/style/filereader_unittest.py:
(TextFileReaderTest.test_process_file__does_not_exist):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (159671 => 159672)
--- trunk/Tools/ChangeLog 2013-11-22 03:17:15 UTC (rev 159671)
+++ trunk/Tools/ChangeLog 2013-11-22 03:49:50 UTC (rev 159672)
@@ -1,3 +1,15 @@
+2013-11-21 Dániel Bátyai <[email protected]>
+
+ In filereader.py, process_file() should throw instead of exiting directly when the file doesn't exist
+ https://bugs.webkit.org/show_bug.cgi?id=124717
+
+ Reviewed by Ryosuke Niwa.
+
+ * Scripts/webkitpy/style/filereader.py:
+ (TextFileReader.process_file):
+ * Scripts/webkitpy/style/filereader_unittest.py:
+ (TextFileReaderTest.test_process_file__does_not_exist):
+
2013-11-21 Mark Rowe <[email protected]>
<https://webkit.org/b/124702> Stop overriding VALID_ARCHS.
Modified: trunk/Tools/Scripts/webkitpy/style/filereader.py (159671 => 159672)
--- trunk/Tools/Scripts/webkitpy/style/filereader.py 2013-11-22 03:17:15 UTC (rev 159671)
+++ trunk/Tools/Scripts/webkitpy/style/filereader.py 2013-11-22 03:49:50 UTC (rev 159672)
@@ -113,7 +113,7 @@
if not self.filesystem.exists(file_path) and file_path != "-":
_log.error("File does not exist: '%s'" % file_path)
- sys.exit(1) # FIXME: This should throw or return instead of exiting directly.
+ raise IOError("File does not exist")
if not self._processor.should_process(file_path):
_log.debug("Skipping file: '%s'" % file_path)
Modified: trunk/Tools/Scripts/webkitpy/style/filereader_unittest.py (159671 => 159672)
--- trunk/Tools/Scripts/webkitpy/style/filereader_unittest.py 2013-11-22 03:17:15 UTC (rev 159671)
+++ trunk/Tools/Scripts/webkitpy/style/filereader_unittest.py 2013-11-22 03:49:50 UTC (rev 159672)
@@ -80,8 +80,8 @@
def test_process_file__does_not_exist(self):
try:
self._file_reader.process_file('does_not_exist.txt')
- except SystemExit, err:
- self.assertEqual(str(err), '1')
+ except IOError, err:
+ self.assertEqual(str(err), "File does not exist")
else:
self.fail('No Exception raised.')
self._assert_file_reader([], 1)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes