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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user