py3: dont use func_name

This commit is contained in:
Kovid Goyal 2019-04-01 17:01:28 +05:30
parent 5e10e3663b
commit b78e24417a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -385,7 +385,7 @@ class Resources(Command): # {{{
src = ''.join(inspect.getsourcelines(func)[0][1:]) src = ''.join(inspect.getsourcelines(func)[0][1:])
except Exception: except Exception:
continue continue
src = src.replace('def ' + func.func_name, 'def replace') src = src.replace('def ' + func.__name__, 'def replace')
imports = ['from %s import %s' % (x.__module__, x.__name__) for x in func.imports] imports = ['from %s import %s' % (x.__module__, x.__name__) for x in func.imports]
if imports: if imports:
src = '\n'.join(imports) + '\n\n' + src src = '\n'.join(imports) + '\n\n' + src