mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
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
1 changed files with 1 additions and 0 deletions
|
@ -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