From 916c27d91596ebd25eba7660a20eeb26a32053cb Mon Sep 17 00:00:00 2001 From: Andrew Rosen Date: Tue, 21 May 2024 08:33:29 -0700 Subject: [PATCH] fix --- custodian/vasp/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custodian/vasp/handlers.py b/custodian/vasp/handlers.py index 4a052f16..1a7707e8 100644 --- a/custodian/vasp/handlers.py +++ b/custodian/vasp/handlers.py @@ -678,8 +678,8 @@ def correct(self, directory="./"): @staticmethod def _get_nbands_from_outcar(directory: str) -> int | None: + nbands = None with open(os.path.join(directory, "OUTCAR")) as file: - nbands = None for line in file: # Have to take the last NBANDS line since sometimes VASP # updates it automatically even if the user specifies it. @@ -691,7 +691,7 @@ def _get_nbands_from_outcar(directory: str) -> int | None: break except (IndexError, ValueError): pass - return nbands + return nbands class LrfCommutatorHandler(ErrorHandler):