bpo-33587: inspect.getsource: reorder stat on file in linecache (GH-6805)
* inspect.getsource: avoid stat on file in linecache The check for os.path.exists() on source file is postponed in inspect.getsourcefile() until needed avoiding an expensive filesystem stat call and PEP 302 module loader check is moved last for performance since it is an uncommon case.
P
Pankaj Pandey committed
c1581a928cc153076593c5c433a8dd36ce10fbfb
Parent: 771eff2
Committed by GitHub <noreply@github.com>
on 8/26/2022, 2:20:48 PM