[issue14803] Add feature to allow code execution prior to __main__ invocation

Antoine Pitrou report at bugs.python.org
Mon Jul 30 03:06:19 CEST 2012


Antoine Pitrou added the comment:

Le lundi 30 juillet 2012 à 00:55 +0000, Nick Coghlan a écrit :
> However, the -C option doesn't cover the case of *implicit* invocation
> of subprocesses. This is where the PYTHONRUNFIRST suggestion comes in
> - the idea would that, unless -E is specified, then -C $PYTHONRUNFIRST
> would be implied.
> 
> To be honest, I *don't* think this latter capability should be built
> into the core implementation. Instead, I think it is more appropriate
> for it to be handled at a virtual environment level, so that it
> doesn't inadvertently affect invocation of other applications (like
> hg) that merely happen to be written in Python.

Well, it shouldn't if you don't start doing "export PYTHONRUNFIRST=...",
but instead set it from the calling Python process (possibly from
coverage itself).

Having to create virtual environments and whatnot just to enjoy this
feature sounds terribly tedious.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14803>
_______________________________________


More information about the Python-bugs-list mailing list