[pypy-commit] jitviewer default: Instead of crashing at load-time if one of the loops' source code
Armin Rigo
noreply at buildbot.pypy.org
Fri Jun 3 16:55:56 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r121:86f36e21deef
Date: 2011-06-03 17:10 +0200
http://bitbucket.org/pypy/jitviewer/changeset/86f36e21deef/
Log: Instead of crashing at load-time if one of the loops' source code
cannot be located, use a DummyLoop instance. At least it lets us
inspect the other loops.
diff --git a/bin/jitviewer.py b/bin/jitviewer.py
--- a/bin/jitviewer.py
+++ b/bin/jitviewer.py
@@ -55,6 +55,10 @@
class CannotFindFile(Exception):
pass
+class DummyFunc(object):
+ def repr(self):
+ return '???'
+
class Server(object):
def __init__(self, storage):
self.storage = storage
@@ -67,9 +71,12 @@
is_entry = True
else:
is_entry = False
- func = FunctionHtml.from_operations(loop.operations, self.storage,
- limit=1,
- inputargs=loop.inputargs)
+ try:
+ func = FunctionHtml.from_operations(loop.operations, self.storage,
+ limit=1,
+ inputargs=loop.inputargs)
+ except CannotFindFile:
+ func = DummyFunc()
func.count = getattr(loop, 'count', '?')
loops.append((is_entry, index, func))
loops.sort(lambda a, b: cmp(b[2].count, a[2].count))
More information about the pypy-commit
mailing list