Fix exception when getting function name for debug_keyboard action dispatch

Fixes #1401
This commit is contained in:
Kovid Goyal
2019-02-23 08:00:21 +05:30
parent aed504efdc
commit e44b331cc3
2 changed files with 12 additions and 4 deletions
+8
View File
@@ -449,3 +449,11 @@ def is_path_in_temp_dir(path):
if q and path.startswith(q):
return True
return False
def func_name(f):
if hasattr(f, '__name__'):
return f.__name__
if hasattr(f, 'func') and hasattr(f.func, '__name__'):
return f.func.__name__
return str(f)