Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82e2a41 commit 4a5d2caCopy full SHA for 4a5d2ca
build_docs.py
@@ -687,10 +687,25 @@ def build(self):
687
f"-D ogp_site_url={site_url}",
688
)
689
690
+ def is_gnu_sed() -> bool:
691
+ """Check if we are using GNU sed."""
692
+ try:
693
+ subprocess.run(
694
+ ["sed", "--version"],
695
+ stdout=subprocess.DEVNULL,
696
+ stderr=subprocess.DEVNULL,
697
+ check=True,
698
+ )
699
+ return True
700
+ except subprocess.CalledProcessError:
701
+ return False
702
+ except FileNotFoundError:
703
704
+
705
# Disable CPython switchers, we handle them now:
706
run(
707
["sed", "-i"]
- + ([""] if sys.platform == "darwin" else [])
708
+ + ([] if is_gnu_sed() else [""])
709
+ ["s/ *-A switchers=1//", self.checkout / "Doc" / "Makefile"]
710
711
self.versions.setup_indexsidebar(
0 commit comments