File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
python_files/vscode_pytest Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -442,7 +442,11 @@ def pytest_sessionfinish(session, exitstatus):
442442 if is_coverage_run == "True" :
443443 # load the report and build the json result to return
444444 import coverage
445- from coverage import exceptions
445+
446+ try :
447+ from coverage .exceptions import NoSource
448+ except ImportError :
449+ from coverage .misc import NoSource
446450
447451 cov = coverage .Coverage ()
448452 cov .load ()
@@ -462,7 +466,7 @@ def pytest_sessionfinish(session, exitstatus):
462466 for file in file_set :
463467 try :
464468 analysis = cov .analysis2 (file )
465- except exceptions . NoSource :
469+ except NoSource :
466470 # as per issue 24308 this best way to handle this edge case
467471 continue
468472 lines_executable = {int (line_no ) for line_no in analysis [1 ]}
You can’t perform that action at this time.
0 commit comments