Commits

Michał Górny committed 0b6bd80

Support stripping EXEEXT from path-detected EPYTHON.

  • Participants
  • Parent commits e77bb28

Comments (0)

Files changed (2)

 CLEANFILES = python-exec tests/python-exec tests/*.tmp*
 python-exec: src/python-exec.in
 	rm -f $@ $@.tmp
-	@SED@ -e "s|[@]bindir@|${bindir}|" $< > $@.tmp
+	@SED@ -e "s|[@]bindir@|${bindir}|" \
+		-e "s|[@]exeext@|${EXEEXT}|g" $< > $@.tmp
 	chmod a-w,a+x $@.tmp
 	mv $@.tmp $@
 

src/python-exec.in

 	from epython import EPYTHON
 except ImportError:
 	EPYTHON = os.path.basename(sys.executable)
+	if '@exeext@' and EPYTHON.endswith('@exeext@'):
+		EPYTHON = EPYTHON[:-len('@exeext@')]
 
 # In the loop:
 # sys.argv[0] keeps the 'bare' name