bpo-37173: Show passed class in inspect.getfile error (GH-13861)
authorPhilipp A <flying-sheep@web.de>
Sat, 8 Jun 2019 12:05:46 +0000 (14:05 +0200)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 8 Jun 2019 12:05:46 +0000 (05:05 -0700)
commitd407d2a7265f6102e51a1d62b3fd28b4f7a78d16
tree6e52402cf0cdff805922a75e13822d54a0acb3f0
parent65e5860fcc8ffe66f3c325d5484112f3b6540e8c
bpo-37173: Show passed class in inspect.getfile error (GH-13861)

Currently, inspect.getfile(str) will report nonsense:

```pytb
>>> inspect.getfile(str)
TypeError: <module 'builtins' (built-in)> is a built-in class
```

This fixes that

https://bugs.python.org/issue37173
Lib/inspect.py
Lib/test/test_inspect.py
Misc/NEWS.d/next/Library/2019-06-08-11-33-48.bpo-37173.0e_8gS.rst [new file with mode: 0644]