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 @@ -687,10 +687,25 @@ def build(self):
687687 f"-D ogp_site_url={ site_url } " ,
688688 )
689689
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+ return False
704+
690705 # Disable CPython switchers, we handle them now:
691706 run (
692707 ["sed" , "-i" ]
693- + (["" ] if sys . platform == "darwin" else [])
708+ + ([] if is_gnu_sed () else ["" ])
694709 + ["s/ *-A switchers=1//" , self .checkout / "Doc" / "Makefile" ]
695710 )
696711 self .versions .setup_indexsidebar (
You can’t perform that action at this time.
0 commit comments