On 22 February 2016 at 16:37, Aníbal Limón <[email protected]> wrote:
> I agree with you to modify avoid_paths_in_environ for return the new > PATH variable is better than only modify it internally but for > simplicity i will maintain the os.environ['PATH'] set/restore instead of > generate the environment line. > Totally agree with Randy here for what it's worth. The environment-munging code in avoid_paths... should return the strings instead of manipulating the current environment so the caller has the choice whether to modify the current environment or pass a new environment to subprocess. And in general I'd say that passing modified environments to subprocess is a cleaner solution as it means that there's no way cleanup can fail to happen. Whilst that's just a try/except now, the code could get copied and extended and end up with codepaths that don't hit the right cleanup. By having an explicit environment passed in, this isn't possible. Ross
-- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
