From 31e6e0ec60dda73da9f4f4a2749f82ee9e7e9161 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 4 Oct 2022 17:09:14 -0700 Subject: [PATCH] just check if file exists rather than trying to open --- examples/bloch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/bloch.py b/examples/bloch.py index 75fc833..2624876 100644 --- a/examples/bloch.py +++ b/examples/bloch.py @@ -32,12 +32,11 @@ def pyfftw_load_wisdom(path): except ImportError as e: pass - try: + if path.exists(): with open(path, 'rb') as f: wisdom = pickle.load(f) pyfftw.import_wisdom(wisdom) - except FileNotFoundError as e: - pass + logger.info('Drawing grid...') dx = 40