MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / collect_try_except_info

Method collect_try_except_info

pydevd.py:786–810  ·  view source on GitHub ↗
(self, code_obj)

Source from the content-addressed store, hash-verified

784 atexit.register(stoptrace)
785
786 def collect_try_except_info(self, code_obj):
787 filename = code_obj.co_filename
788 try:
789 if os.path.exists(filename):
790 pydev_log.debug("Collecting try..except info from source for %s", filename)
791 try_except_infos = collect_try_except_info_from_source(filename)
792 if try_except_infos:
793 # Filter for the current function
794 max_line = -1
795 min_line = sys.maxsize
796 for _, line in dis.findlinestarts(code_obj):
797 if line is not None:
798 if line > max_line:
799 max_line = line
800 if line < min_line:
801 min_line = line
802
803 try_except_infos = [x for x in try_except_infos if min_line <= x.try_line <= max_line]
804 return try_except_infos
805
806 except:
807 pydev_log.exception("Error collecting try..except info from source (%s)", filename)
808
809 pydev_log.debug("Collecting try..except info from bytecode for %s", filename)
810 return collect_try_except_info(code_obj)
811
812 def setup_auto_reload_watcher(self, enable_auto_reload, watch_dirs, poll_target_time, exclude_patterns, include_patterns):
813 try:

Callers 2

_unwind_eventFunction · 0.80
is_unhandled_exceptionFunction · 0.80

Calls 3

collect_try_except_infoFunction · 0.90
exceptionMethod · 0.80

Tested by

no test coverage detected