forked from mirrors/nixpkgs
python: fix argv[0] for wrapped console_scripts.
Previously programs would see '.<program>-wrapped' as their program name. This is a workaround but should be reasonably safe and reliable.
This commit is contained in:
parent
077d989ad1
commit
24ef871e6a
|
@ -26,6 +26,7 @@ wrapPythonProgramsIn() {
|
|||
# dont wrap EGG-INFO scripts since they are called from python
|
||||
if echo "$i" | grep -v EGG-INFO/scripts; then
|
||||
echo "wrapping \`$i'..."
|
||||
sed -i "$i" -e "/^#\!/a import sys; sys.argv[0] = '$(basename $i)'"
|
||||
wrapProgram "$i" \
|
||||
--prefix PYTHONPATH ":" $program_PYTHONPATH \
|
||||
--prefix PATH ":" $program_PATH
|
||||
|
|
Loading…
Reference in a new issue