# debugger: Add program and module path fallbacks for debugpy toolchain \(\#40975\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/07dcb8f2bb0a28290a2a05d57995cb9ca2a5bf97)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 07dcb8f2bb0a28290a2a05d57995cb9ca2a5bf97

Requested commit: 07dcb8f2bb0a28290a2a05d57995cb9ca2a5bf97

Commit: 07dcb8f2bb0a28290a2a05d57995cb9ca2a5bf97

Tree: ce3275d8af44cce6df39a03e6806f161097c7ded

Author: Anthony Eid

Committer: GitHub

## Message

```
debugger: Add program and module path fallbacks for debugpy toolchain (#40975)

Fixes the Debugpy toolchain detection bug in #40324 

When detecting what toolchain (venv) to use in the Debugpy configuration
stage, we used to only base it off of the current working directory
argument passed to the config. This is wrong behavior for cases like
mono repos, where the correct virtual environment to use is nested in
another folder.

This PR fixes this issue by adding the program and module fields as
fallbacks to check for virtual environments. We also added support for
program/module relative paths as well when cwd is not None.

Release Notes:

- debugger: Improve mono repo virtual environment detection with Debugpy

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
```

## Parents

- [06bdb28517d085d5c7635dacc15d4731a1b97d66](https://git.cafe/gitcafe/zed/commit/06bdb28517d085d5c7635dacc15d4731a1b97d66?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/07dcb8f2bb0a28290a2a05d57995cb9ca2a5bf97?format=markdown)
