Skip to content

profiler: use stdlib for FS path mangling #7266

@oliver-sanders

Description

@oliver-sanders

Follow on from #6663

We avoid direct path catination, e.g:

path = '/bin/' + app + 'launch'

Partly because it's messy, partly because it's easy to get wrong, partly because / is only a convention (see os.sep).

To avoid this fuss, Python provides some functions that do this for you, e.g:

from pathlib import Path
path = Path('bin', app, 'launch')

Let pathlib do the mangling for us.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions