Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def _is_debugger_running():
  2. for frame in sys._current_frames().values():
  3. current_frame = frame
  4. while True:
  5. if os.path.basename(current_frame.f_code.co_filename) == 'bdb.py':
  6. return True
  7.  
  8. if not current_frame.f_back:
  9. break
  10.  
  11. current_frame = current_frame.f_back
  12.  
  13. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement