-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve scrubbing of namespace packages
Problem: since we can't force python -S using /usr/bin/env, we can't prevent importing site. But 'import site' populates sys.modules with placeholder modules containing .__path__ attributes with site-packages baked in. This means even if we scrub sys.path and sys.path_importer_cache, it's still possible for __import__ to pick up things from site-packages. This scrubs sys.modules as well. Reviewed at https://rbcommons.com/s/twitter/r/116/ (sapling split of a11f3bc4d0fa25aebf803ce2b511e7bff45f83f5)
- Loading branch information
Showing
2 changed files
with
93 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters