code/source: remove old IndentationError workaround in getsource()

This has been there since as far as the git history goes (2007), is not
covered by any test, and says "Buggy python version consider upgrading".
Hopefully everyone have upgraded...
This commit is contained in:
Ran Benita 2020-07-01 20:20:08 +03:00
parent 4108174777
commit c6083ab970
1 changed files with 1 additions and 4 deletions

View File

@ -308,10 +308,7 @@ def getrawcode(obj, trycall: bool = True):
def getsource(obj) -> Source:
obj = getrawcode(obj)
try:
strsrc = inspect.getsource(obj)
except IndentationError:
strsrc = '"Buggy python version consider upgrading, cannot get source"'
strsrc = inspect.getsource(obj)
assert isinstance(strsrc, str)
return Source(strsrc)