Permalink
Browse files

Graceful errors when source cannot be read

  • Loading branch information...
1 parent a7b5419 commit db87ea5089fc85947b2823046de69132779e70bb @dcramer committed Mar 16, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 peek/tracer.py
View
@@ -109,7 +109,10 @@ def _get_struct(self, frame, event):
f_globals = getattr(frame, 'f_globals', {})
module_name = f_globals.get('__name__')
- source, lineno = inspect.getsourcelines(frame)
+ try:
+ source, lineno = inspect.getsourcelines(frame)
+ except IOError:
+ source, lineno = [], 0
pre_frame = frame.f_back

0 comments on commit db87ea5

Please sign in to comment.