File tree 1 file changed +6
-21
lines changed
1 file changed +6
-21
lines changed Original file line number Diff line number Diff line change @@ -687,27 +687,12 @@ def build(self):
687
687
f"-D ogp_site_url={ site_url } " ,
688
688
)
689
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
- return False
704
-
705
- # Disable CPython switchers, we handle them now:
706
- run (
707
- ["sed" , "-i" ]
708
- + ([] if is_gnu_sed () else ["" ])
709
- + ["s/ *-A switchers=1//" , self .checkout / "Doc" / "Makefile" ]
710
- )
690
+ if self .version .as_tuple () < (3 , 8 ):
691
+ # Disable CPython switchers, we handle them now:
692
+ text = (self .checkout / "Doc" / "Makefile" ).read_text (encoding = "utf-8" )
693
+ text = text .replace (" -A switchers=1" , "" )
694
+ (self .checkout / "Doc" / "Makefile" ).write_text (text , encoding = "utf-8" )
695
+
711
696
self .versions .setup_indexsidebar (
712
697
self .version ,
713
698
self .checkout / "Doc" / "tools" / "templates" / "indexsidebar.html" ,
You can’t perform that action at this time.
0 commit comments