File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -1617,19 +1617,6 @@ def render_function(
16171617 return clinic .get_destination ('block' ).dump ()
16181618
16191619
1620-
1621-
1622- @contextlib .contextmanager
1623- def OverrideStdioWith (stdout ):
1624- saved_stdout = sys .stdout
1625- sys .stdout = stdout
1626- try :
1627- yield
1628- finally :
1629- assert sys .stdout is stdout
1630- sys .stdout = saved_stdout
1631-
1632-
16331620def create_regex (
16341621 before : str ,
16351622 after : str ,
@@ -2331,17 +2318,14 @@ def compute_checksum(
23312318 return s
23322319
23332320
2334-
2335-
23362321class PythonParser :
23372322 def __init__ (self , clinic : Clinic ) -> None :
23382323 pass
23392324
23402325 def parse (self , block : Block ) -> None :
2341- s = io .StringIO ()
2342- with OverrideStdioWith (s ):
2326+ with contextlib .redirect_stdout (io .StringIO ()) as s :
23432327 exec (block .input )
2344- block .output = s .getvalue ()
2328+ block .output = s .getvalue ()
23452329
23462330
23472331class Module :
You can’t perform that action at this time.
0 commit comments