File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -657,10 +657,25 @@ def build(self):
657657 f"-D ogp_site_url={ site_url } " ,
658658 )
659659
660+ def is_gnu_sed () -> bool :
661+ """Check if we are using GNU sed."""
662+ try :
663+ subprocess .run (
664+ ["sed" , "--version" ],
665+ stdout = subprocess .DEVNULL ,
666+ stderr = subprocess .DEVNULL ,
667+ check = True ,
668+ )
669+ return True
670+ except subprocess .CalledProcessError :
671+ return False
672+ except FileNotFoundError :
673+ return False
674+
660675 # Disable CPython switchers, we handle them now:
661676 run (
662677 ["sed" , "-i" ]
663- + (["" ] if sys . platform == "darwin" else [])
678+ + ([] if is_gnu_sed () else ["" ])
664679 + ["s/ *-A switchers=1//" , self .checkout / "Doc" / "Makefile" ]
665680 )
666681 self .versions .setup_indexsidebar (
You can’t perform that action at this time.
0 commit comments