Skip to content

Commit

Permalink
Exclude more exceptional cases from coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Minaev authored and int19h committed Sep 5, 2023
1 parent 9df16ce commit 9df4bbd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/debugpy/common/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def report_paths(get_paths, label=None):
except AttributeError:
report("{0}<missing>\n", prefix)
return
except Exception:
except Exception: # pragma: no cover
swallow_exception(
"Error evaluating {0}",
repr(expr) if expr else util.srcnameof(get_paths),
Expand Down Expand Up @@ -352,14 +352,14 @@ def report_paths(get_paths, label=None):
from importlib import metadata as importlib_metadata
except ImportError:
pass
if importlib_metadata is None:
if importlib_metadata is None: # pragma: no cover
report("Cannot enumerate installed packages - missing importlib_metadata.")
else:
report("Installed packages:\n")
try:
for pkg in importlib_metadata.distributions():
report(" {0}=={1}\n", pkg.name, pkg.version)
except Exception:
except Exception: # pragma: no cover
swallow_exception("Error while enumerating installed packages.")

return "".join(result).rstrip("\n")
Expand Down

0 comments on commit 9df4bbd

Please sign in to comment.