diff --git a/slothy/helper.py b/slothy/helper.py index 41ca1be9..5521d1d9 100644 --- a/slothy/helper.py +++ b/slothy/helper.py @@ -503,6 +503,9 @@ def change_funcname(line): s = re.sub( f"{old_funcname}:", f"{new_funcname}:", s) s = re.sub( f"\\.global(\\s+){old_funcname}", f".global\\1{new_funcname}", s) s = re.sub( f"\\.type(\\s+){old_funcname}", f".type\\1{new_funcname}", s) + # On Mac, function names often start with an underscore + s = re.sub( f"\\.global(\\s+)_{old_funcname}", f".global\\1_{new_funcname}", s) + s = re.sub( f"\\.type(\\s+)_{old_funcname}", f".type\\1_{new_funcname}", s) return line.copy().set_text(s) return [ change_funcname(s) for s in source ]