From 76984a4dbd74e3a338f3fcb3baa5696e16ad371a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 Mar 2020 23:42:23 +0100 Subject: [PATCH] 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 --- python/damask/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/util.py b/python/damask/util.py index b73206067..273da8c1e 100644 --- a/python/damask/util.py +++ b/python/damask/util.py @@ -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()