more sensible check

works also for numpy arrays. Not sure why the old way is considered to
be "pythonic", I think it can just cause trouble
This commit is contained in:
Martin Diehl 2020-03-20 23:42:23 +01:00
parent 48c9d31720
commit 76984a4dbd
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ def croak(what, newline = True):
Separate items of what by newline. Defaults to True.
"""
if what:
if what is not None:
sys.stderr.write(srepr(what,glue = '\n') + ('\n' if newline else ''))
sys.stderr.flush()