summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake')
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake3
1 files changed, 1 insertions, 2 deletions
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
index 395faffa5a..06e061e212 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
@@ -185,7 +185,6 @@ function(GR_PYTHON_INSTALL)
COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
)
-
####################################################################
elseif(GR_PYTHON_INSTALL_PROGRAMS)
####################################################################
@@ -207,7 +206,7 @@ function(GR_PYTHON_INSTALL)
add_custom_command(
OUTPUT ${pyexefile} DEPENDS ${pyfile}
COMMAND ${PYTHON_EXECUTABLE} -c
- "open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())"
+ "import re; R=re.compile('^\#!.*$\\n',flags=re.MULTILINE); open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+R.sub('',open('${pyfile}','r').read()))"
COMMENT "Shebangin ${pyfile_name}"
VERBATIM
)