diff --git a/var/spack/repos/builtin/packages/mercurial/package.py b/var/spack/repos/builtin/packages/mercurial/package.py index a32e2d190d..748c546b85 100644 --- a/var/spack/repos/builtin/packages/mercurial/package.py +++ b/var/spack/repos/builtin/packages/mercurial/package.py @@ -69,8 +69,7 @@ def configure_certificates(self): hgrc_filename = etc_dir.hgrc # Use certifi to find the location of the CA certificate - print_str = self.spec["python"].package.print_string("certifi.where()") - certificate = python("-c", "import certifi; " + print_str, output=str) + certificate = python("-c", "import certifi; print(certifi.where())", output=str) if not certificate: tty.warn( diff --git a/var/spack/repos/builtin/packages/py-pybind11/package.py b/var/spack/repos/builtin/packages/py-pybind11/package.py index 1ebc198bf6..5e80f0d61c 100644 --- a/var/spack/repos/builtin/packages/py-pybind11/package.py +++ b/var/spack/repos/builtin/packages/py-pybind11/package.py @@ -105,8 +105,7 @@ def install_test(self): python = self.spec["python"].command py_inc = python( "-c", - "import pybind11 as py; " - + self.spec["python"].package.print_string("py.get_include()"), + "import pybind11 as py; print(py.get_include())", output=str, ).strip() for inc in [py_inc, self.prefix.include]: