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(
1617
1617
return clinic .get_destination ('block' ).dump ()
1618
1618
1619
1619
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
-
1633
1620
def create_regex (
1634
1621
before : str ,
1635
1622
after : str ,
@@ -2331,17 +2318,14 @@ def compute_checksum(
2331
2318
return s
2332
2319
2333
2320
2334
-
2335
-
2336
2321
class PythonParser :
2337
2322
def __init__ (self , clinic : Clinic ) -> None :
2338
2323
pass
2339
2324
2340
2325
def parse (self , block : Block ) -> None :
2341
- s = io .StringIO ()
2342
- with OverrideStdioWith (s ):
2326
+ with contextlib .redirect_stdout (io .StringIO ()) as s :
2343
2327
exec (block .input )
2344
- block .output = s .getvalue ()
2328
+ block .output = s .getvalue ()
2345
2329
2346
2330
2347
2331
class Module :
You can’t perform that action at this time.
0 commit comments