cpython/Lib/test/test_inspect
kernc 52ef4430a9
gh-71765: Fix inspect.getsource() on empty file (GH-20809)
* bpo-27578: Fix inspect.getsource() on empty file

For modules from empty files, `inspect.getsource()` now
returns an empty string, and `inspect.getsourcelines()` returns
a list of one empty string, fixing the expected invariant.

As indicated by `exec('')`, empty strings are valid Python
source code.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2024-03-18 16:13:02 +01:00
..
__init__.py
inspect_fodder.py gh-101860: Expose __name__ on property (GH-101876) 2024-02-20 17:14:34 +02:00
inspect_fodder2.py
inspect_stock_annotations.py
inspect_stringized_annotations.py
inspect_stringized_annotations_2.py
test_inspect.py gh-71765: Fix inspect.getsource() on empty file (GH-20809) 2024-03-18 16:13:02 +01:00