Skip to content

Commit 27b193b

Browse files
authored
Provide a backup suffix for sed -i (in-place) option when on MacOS (python#177)
Backup suffix following the -i option is required on macOS.
1 parent fd8620b commit 27b193b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

build_docs.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import logging.handlers
3131
from functools import total_ordering
3232
from os import readlink
33+
import platform
3334
import re
3435
import shlex
3536
import shutil
@@ -745,13 +746,14 @@ def build(self):
745746
sphinxbuild = self.venv / "bin" / "sphinx-build"
746747
blurb = self.venv / "bin" / "blurb"
747748
# Disable cpython switchers, we handle them now:
749+
750+
def is_mac():
751+
return platform.system() == 'Darwin'
752+
748753
run(
749-
[
750-
"sed",
751-
"-i",
752-
"s/ *-A switchers=1//",
753-
self.checkout / "Doc" / "Makefile",
754-
]
754+
["sed", "-i"]
755+
+ ([""] if is_mac() else [])
756+
+ ["s/ *-A switchers=1//", self.checkout / "Doc" / "Makefile"]
755757
)
756758
self.version.setup_indexsidebar(
757759
self.versions,

0 commit comments

Comments
 (0)