From 250498af9c904dd7ba4f72d403a3100f9b46dfbe Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Wed, 16 Oct 2024 15:12:30 -0500 Subject: [PATCH] DEBUG_ENABLED: use strtobool --- pytato/__init__.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pytato/__init__.py b/pytato/__init__.py index 0c6d27499..56254b928 100644 --- a/pytato/__init__.py +++ b/pytato/__init__.py @@ -28,19 +28,15 @@ """ # {{{ debug control + import os from numpy import dtype +from pytools import strtobool -try: - v = os.environ.get("PYTATO_DEBUG") - if v is None: - v = "" - DEBUG_ENABLED = bool(eval(v)) -except Exception: - DEBUG_ENABLED = False +DEBUG_ENABLED = strtobool(os.environ.get("PYTATO_DEBUG", "no")) def set_debug_enabled(flag: bool) -> None: