From 0de702a56e634ca1ce1d2c39b3bd9de6ee55ab03 Mon Sep 17 00:00:00 2001 From: Yvan Denis Date: Mon, 21 Nov 2022 19:04:47 +0100 Subject: [PATCH] Fix - Do not split abspath with dot --- joblib/func_inspect.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/joblib/func_inspect.py b/joblib/func_inspect.py index d334a2b9d..7f1d191a7 100644 --- a/joblib/func_inspect.py +++ b/joblib/func_inspect.py @@ -119,7 +119,8 @@ def get_func_name(func, resolv_alias=True, win_characters=True): if module is None: # Happens in doctests, eg module = '' - if module == '__main__': + module = module.split('.') + if module == ['__main__']: try: filename = os.path.abspath(inspect.getsourcefile(func)) except: @@ -152,8 +153,7 @@ def get_func_name(func, resolv_alias=True, win_characters=True): filename = '-'.join(parts) if filename.endswith('.py'): filename = filename[:-3] - module = module + '-' + filename - module = module.split('.') + module[0] = module[0] + '-' + filename if hasattr(func, 'func_name'): name = func.func_name elif hasattr(func, '__name__'):