webscopeio / license.sh

License checker tool - We're in a beta phase, any help is appreciated, especially reporting issues
https://webscopeio.github.io/license.sh
MIT License
40 stars 6 forks source link

yaspin is outputing text in json mode #19

Closed jvorcak closed 5 years ago

jvorcak commented 5 years ago

When outputing json, we shuld not output anything to std output.

Since we're using yaspin, we can provide a null context in certain cases to fix this

from contextlib import nullcontext

with (open(file) if file else nullcontext()) as FILE:
    # Do something with `FILE`
    pass