Completed
Push — master ( 12c888...988ad6 )
by Thomas
11:22
created

exabgp.logger.tty.istty()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
import sys
2
3
4
def _istty(std):
5
    try:
6
        return std.isatty()
7
    except Exception:
8
        return False
9
10
11
_std = {
12
    'stderr': sys.stderr,
13
    'stdout': sys.stdout,
14
    'out': sys.stdout,
15
}
16
17
18
def istty(std):
19
    return _istty(_std[std])
20