Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - Do not split abspath with dot #1364

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions joblib/func_inspect.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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__'):
Expand Down