| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 from collections import namedtuple | 6 from collections import namedtuple |
| 7 | 7 |
| 8 from crash.stacktrace import Stacktrace | 8 from crash.stacktrace import Stacktrace |
| 9 | 9 |
| 10 class CrashReport(namedtuple('CrashReport', | 10 class CrashReport(namedtuple('CrashReport', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 we do not store the string itself. | 28 we do not store the string itself. |
| 29 regression_range : a pair of the last-good and first-bad | 29 regression_range : a pair of the last-good and first-bad |
| 30 versions. N.B., because this is an input, it is up to clients | 30 versions. N.B., because this is an input, it is up to clients |
| 31 to call DetectRegressionRange (or whatever else) in order to | 31 to call DetectRegressionRange (or whatever else) in order to |
| 32 provide this information. | 32 provide this information. |
| 33 """ | 33 """ |
| 34 __slots__ = () | 34 __slots__ = () |
| 35 | 35 |
| 36 def __new__(cls, crashed_version, signature, platform, stacktrace, | 36 def __new__(cls, crashed_version, signature, platform, stacktrace, |
| 37 regression_range): | 37 regression_range): |
| 38 # TODO: should raise a TypeError rather than an AssertionError | 38 assert isinstance(stacktrace, Stacktrace), TypeError( |
| 39 assert isinstance(stacktrace, Stacktrace), ( | |
| 40 'In the fourth argument to CrashReport constructor, ' | 39 'In the fourth argument to CrashReport constructor, ' |
| 41 'expected Stacktrace object, but got %s object instead.' | 40 'expected Stacktrace object, but got %s object instead.' |
| 42 % stacktrace.__class__.__name__) | 41 % stacktrace.__class__.__name__) |
| 43 | 42 |
| 44 return super(cls, CrashReport).__new__(cls, | 43 return super(cls, CrashReport).__new__(cls, |
| 45 crashed_version, signature, platform, stacktrace, regression_range) | 44 crashed_version, signature, platform, stacktrace, regression_range) |
| OLD | NEW |