uv
457d4526 - Update activate_this.py to use runpy instead of exec in the docstring (#3442)

Commit
1 year ago
Update activate_this.py to use runpy instead of exec in the docstring (#3442) ## Summary 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 any bandit-derived ruff check. (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. (But that could be fixed with an __import__('runpy').run_path...) ## Test Plan import runpy runpy.run_path('/path/to/venv/bin/activate_this.py')
Author
Parents
Loading