Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Side by Side Diff: appengine/findit/crash/crash_report.py

Issue 2557423003: Making Stacktrace immutable, so it can be hashable (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | appengine/findit/crash/stacktrace.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/crash/stacktrace.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698