Skip to content

Commit b8bd716

Browse files
authored
Fix bug with --pdb and pytask-latex. (#296)
1 parent 22a1178 commit b8bd716

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/source/changes.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
1111
- {pull}`289` shortens the task ids when using `pytask collect`. Fixes {issue}`286`.
1212
- {pull}`290` implements a dry-run with `pytask --dry-run` to see which tasks would be
1313
executed.
14+
- {pull}`296` fixes a bug where the source code of wrapped function could not be
15+
retrieved.
1416

1517
## 0.2.4 - 2022-06-28
1618

src/_pytask/console.py

+2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ def _get_source_lines(function: Callable[..., Any]) -> int:
216216
"""Get the source line number of the function."""
217217
if isinstance(function, functools.partial):
218218
return _get_source_lines(function.func)
219+
elif hasattr(function, "__wrapped__"):
220+
return _get_source_lines(function.__wrapped__) # type: ignore[attr-defined]
219221
else:
220222
return inspect.getsourcelines(function)[1]
221223

0 commit comments

Comments
 (0)