Commits

Armin Rigo  committed 86f36e2

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.

  • Participants
  • Parent commits 585a52c

Comments (0)

Files changed (1)

File bin/jitviewer.py

 class CannotFindFile(Exception):
     pass
 
+class DummyFunc(object):
+    def repr(self):
+        return '???'
+
 class Server(object):
     def __init__(self, storage):
         self.storage = storage
                 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))