From e39df4d663c91b66f015229bdff433781c90f785 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Thu, 28 Jul 2022 19:24:38 -0600 Subject: [PATCH] Sigh 'stable' releases --- projects/cram/src/python/cram/common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/cram/src/python/cram/common.py b/projects/cram/src/python/cram/common.py index 6e952f7..35948bd 100644 --- a/projects/cram/src/python/cram/common.py +++ b/projects/cram/src/python/cram/common.py @@ -1,14 +1,21 @@ #!/usr/bin/env python3 +import os from pathlib import Path from shlex import quote as sh_quote +import sys from typing import List, Optional from vfs import Vfs +# FIXME: This should be a config somewhere SHELL = "/bin/sh" +# Light monkeypatching because macos ships a "stable" a py +if sys.version_info <= (3, 9, 0): + Path.readlink = lambda p: Path(os.readlink(str(p))) + def sh(cmd: List[str], /, env: Optional[dict] = None):