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

exabgp.logger.tty   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

2 Functions

Rating   Name   Duplication   Size   Complexity  
A istty() 0 2 1
A _istty() 0 5 2
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