runpy.run_path was added in python 2.7 and 3.2 - and every python that is not EOL supports it.
It is arguably nicer to read and the path is only given once in the command.
At least right now, runpy - unlike exec with S102 - is not flagged by bandit or bandit-derived (eg. ruff) checks.
(I guess because it loads from a file instead of a simple string...)
Because of the import, it is also not a one-liner anymore.
Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)
[X] ran the linter to address style issues (tox -e fix)
[X] wrote descriptive pull request text
[X] ensured there are test(s) validating the fix - the change only updates documentation
[X] added news fragment in docs/changelog folder: This is a tiny change, so I'm not sure it warrants a news fragment
runpy.run_path was added in python 2.7 and 3.2 - and every python that is not EOL supports it.
It is arguably nicer to read and the path is only given once in the command.
At least right now, runpy - unlike exec with S102 - is not flagged by bandit or bandit-derived (eg. ruff) checks. (I guess because it loads from a file instead of a simple string...)
Because of the import, it is also not a one-liner anymore.
Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)
tox -e fix
)docs/changelog
folder: This is a tiny change, so I'm not sure it warrants a news fragment