Completed
Push — master ( 13dc98...362bd5 )
by Shlomi
25s queued 12s
created

ethically.utils._warning_setup()   A

Complexity

Conditions 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 2
nop 0
1
import warnings
2
3
4
# https://stackoverflow.com/questions/2187269/print-only-the-message-on-warnings
5
def _warning_setup():
6
    # pylint: disable=line-too-long
7
    formatwarning_orig = warnings.formatwarning
8
    warnings.formatwarning = lambda message, category, filename, lineno, line=None: \
9
        formatwarning_orig(message, category, filename, lineno, line='')
10