File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ Capture C-level stdout/stderr pipes in Python via `os.dup2`.
11
11
Capture stdout/stderr in pipes:
12
12
13
13
``` python
14
- from wurlitzer import capture
14
+ from wurlitzer import pipes
15
15
16
- with capture () as (out, err):
16
+ with pipes () as (out, err):
17
17
call_some_c_function()
18
18
19
19
stdout = out.read()
@@ -23,10 +23,10 @@ Capture stdout/stderr in StringIO:
23
23
24
24
``` python
25
25
from io import StringIO
26
- from wurlitzer import capture , STDOUT
26
+ from wurlitzer import pipes , STDOUT
27
27
28
28
out = StringIO()
29
- with capture (stdout = out, stderr = STDOUT ):
29
+ with pipes (stdout = out, stderr = STDOUT ):
30
30
call_some_c_function()
31
31
32
32
stdout = out.getvalue()
@@ -36,9 +36,9 @@ Forward C-level stdout/stderr to Python sys.stdout/stderr,
36
36
which may already be forwarded somewhere by the environment, e.g. IPython:
37
37
38
38
``` python
39
- from wurlitzer import redirect_to_sys
39
+ from wurlitzer import sys_pipes
40
40
41
- with redirect_to_sys ():
41
+ with sys_pipes ():
42
42
call_some_c_function()
43
43
```
44
44
Original file line number Diff line number Diff line change 6
6
long_description = """
7
7
Context managers for capturing C-level output::
8
8
9
- from wurlitzer import capture
9
+ from wurlitzer import pipes
10
10
11
- with capture () as (stdout, stderr):
11
+ with pipes () as (stdout, stderr):
12
12
call_c_function()
13
13
out = stdout.read()
14
14
err = stderr.read()
You can’t perform that action at this time.
0 commit comments