diff --git a/easybuild/easyblocks/m/molpro.py b/easybuild/easyblocks/m/molpro.py index 5f3f3b80ff3..f83fa3a4c84 100644 --- a/easybuild/easyblocks/m/molpro.py +++ b/easybuild/easyblocks/m/molpro.py @@ -240,11 +240,11 @@ def install_step(self): # Make sure that the launcher text we replace (where this is done) is not # the instance of setting LAUNCHER that contains the eval. - launchertext = r"^(LAUNCHER\s*=\s*)((?!\"`eval echo \$LAUNCHER` \$MOLPRO_OPTIONS\").)*$" + launchertext = r"^(LAUNCHER\s*=)\s*((?!\"`eval echo \$LAUNCHER` \$MOLPRO_OPTIONS\").)*$" if self.cfg['parallel_launcher'] is not None: - apply_regex_substitutions(molpro_exe, [(launchertext, r'\1 "%s"' % self.cfg['parallel_launcher'])]) + apply_regex_substitutions(molpro_exe, [(launchertext, r'\1"%s"' % self.cfg['parallel_launcher'])]) elif self.orig_launcher is not None: - apply_regex_substitutions(molpro_exe, [(launchertext, r"\1 %s" % self.orig_launcher)]) + apply_regex_substitutions(molpro_exe, [(launchertext, r'\1"%s"' % self.orig_launcher)]) if self.cleanup_token_symlink: try: