Changeset 106721 in webkit
- Timestamp:
- Feb 3, 2012 5:41:14 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r106714 r106721 1 2012-02-03 Dirk Pranke <dpranke@chromium.org> 2 3 webkitpy: change exit() calls to sys.exit(), fix a leak in outputcapture 4 https://bugs.webkit.org/show_bug.cgi?id=77781 5 6 Reviewed by Eric Seidel. 7 8 This change fixes a couple of issues discovered while debugging 9 test-webkitpy; both calling exit() instead of sys.exit() -- 10 which is discouraged in program code instead of the interpreter 11 -- and a particular usage of outputcapture were stdin to get whacked 12 and preventing debugging. 13 14 This change introduces a couple of common _exit() methods that 15 will standardize how webkit-patch exit's, in case we need to do 16 something different in the future. 17 18 * Scripts/webkitpy/common/system/deprecated_logging.py: 19 (error): 20 * Scripts/webkitpy/common/system/outputcapture.py: 21 (OutputCapture.assert_outputs): 22 * Scripts/webkitpy/tool/bot/queueengine.py: 23 (QueueEngine.exit_after_handled_error): 24 * Scripts/webkitpy/tool/commands/abstractsequencedcommand.py: 25 (AbstractSequencedCommand.execute): 26 * Scripts/webkitpy/tool/commands/queues.py: 27 (StyleQueue.handle_script_error): 28 * Scripts/webkitpy/tool/commands/upload.py: 29 (MarkBugFixed.execute): 30 * Scripts/webkitpy/tool/multicommandtool.py: 31 (Command._exit): 32 * Scripts/webkitpy/tool/steps/abstractstep.py: 33 (AbstractStep._exit): 34 * Scripts/webkitpy/tool/steps/checkstyle.py: 35 (CheckStyle.run): 36 * Scripts/webkitpy/tool/steps/commit.py: 37 (Commit._check_test_expectations): 38 * Scripts/webkitpy/tool/steps/confirmdiff.py: 39 (ConfirmDiff.run): 40 1 41 2012-02-03 Ryosuke Niwa <rniwa@webkit.org> 2 42 -
trunk/Tools/Scripts/webkitpy/common/system/deprecated_logging.py
r58036 r106721 42 42 def error(string): 43 43 log("ERROR: %s" % string) 44 exit(1)44 sys.exit(1) 45 45 46 46 -
trunk/Tools/Scripts/webkitpy/common/system/outputcapture.py
r101533 r106721 75 75 def assert_outputs(self, testcase, function, args=[], kwargs={}, expected_stdout="", expected_stderr="", expected_exception=None, expected_logs=None): 76 76 self.capture_output() 77 if expected_exception: 78 return_value = testcase.assertRaises(expected_exception, function, *args, **kwargs) 79 else: 80 return_value = function(*args, **kwargs) 81 (stdout_string, stderr_string, logs_string) = self.restore_output() 77 try: 78 if expected_exception: 79 return_value = testcase.assertRaises(expected_exception, function, *args, **kwargs) 80 else: 81 return_value = function(*args, **kwargs) 82 finally: 83 (stdout_string, stderr_string, logs_string) = self.restore_output() 84 82 85 testcase.assertEqual(stdout_string, expected_stdout) 83 86 testcase.assertEqual(stderr_string, expected_stderr) -
trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py
r89618 r106721 29 29 30 30 import os 31 import sys 31 32 import time 32 33 import traceback … … 87 88 def exit_after_handled_error(cls, error): 88 89 log(error) 89 exit(cls.handled_error_code)90 sys.exit(cls.handled_error_code) 90 91 91 92 def run(self): -
trunk/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
r73951 r106721 47 47 except ScriptError, e: 48 48 log(e.message_with_output()) 49 exit(e.exit_code or 2)49 self._exit(e.exit_code or 2) 50 50 51 51 self._sequence.run_and_handle_errors(tool, options, state) -
trunk/Tools/Scripts/webkitpy/tool/commands/queues.py
r100697 r106721 31 31 32 32 import codecs 33 import os 34 import sys 33 35 import time 34 36 import traceback 35 import os36 37 37 38 from datetime import datetime … … 441 442 message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024)) 442 443 tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers) 443 exit(1)444 sys.exit(1) -
trunk/Tools/Scripts/webkitpy/tool/commands/upload.py
r101834 r106721 411 411 if needs_prompt: 412 412 if not tool.user.confirm("Is this correct?"): 413 exit(1)413 self._exit(1) 414 414 415 415 bug_comment = bug_comment_from_svn_revision(svn_revision) -
trunk/Tools/Scripts/webkitpy/tool/multicommandtool.py
r67916 r106721 59 59 self.option_parser = HelpPrintingOptionParser(usage=SUPPRESS_USAGE, add_help_option=False, option_list=self.options) 60 60 61 def _exit(self, code): 62 sys.exit(code) 63 61 64 # This design is slightly awkward, but we need the 62 65 # the tool to be able to create and modify the option_parser -
trunk/Tools/Scripts/webkitpy/tool/steps/abstractstep.py
r101834 r106721 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import sys 30 29 31 from webkitpy.common.system.executive import ScriptError 30 32 from webkitpy.common.config.ports import WebKitPort … … 36 38 self._tool = tool 37 39 self._options = options 40 41 def _exit(self, code): 42 sys.exit(code) 38 43 39 44 def _changed_files(self, state): -
trunk/Tools/Scripts/webkitpy/tool/steps/checkstyle.py
r97521 r106721 68 68 raise e 69 69 if not self._tool.user.confirm("Are you sure you want to continue?"): 70 exit(1)70 self._exit(1) -
trunk/Tools/Scripts/webkitpy/tool/steps/commit.py
r105213 r106721 26 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 29 import sys 28 30 29 31 from webkitpy.common.checkout.scm import AuthenticationError, AmbiguousCommitError … … 66 68 except ScriptError, e: 67 69 if not self._tool.user.confirm("Are you sure you want to continue?", default="n"): 68 exit(1)70 self._exit(1) 69 71 70 72 def run(self, state): -
trunk/Tools/Scripts/webkitpy/tool/steps/confirmdiff.py
r60666 r106721 75 75 pretty_diff_file.close() 76 76 if not diff_correct: 77 exit(1)77 self._exit(1)
Note: See TracChangeset
for help on using the changeset viewer.