Completed
Push — master ( d5fdbe...1b7e63 )
by srz
08:59 queued 04:24
created

travis_blocking_stdout   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A to_blocking_mode() 0 6 2
1
import fcntl, os
2
from sys import stdout, stderr
3
4
def to_blocking_mode(channel):
5
    flags = fcntl.fcntl(channel, fcntl.F_GETFL)
6
    if flags & os.O_NONBLOCK:
7
        fcntl.fcntl(channel, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)
8
        return True
9
    return False
10
11
if to_blocking_mode(stderr):
12
    stderr.writelines(["Reset STDERR to blocking"])
13
if to_blocking_mode(stdout):
14
    stderr.writelines(["Reset STDOUT to blocking"])
15