From 05ae927e4c1429a94bf2ca796e281b30b6fc0179 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Sun, 13 Oct 2024 00:03:36 -0700 Subject: [PATCH] Don't shadow filehandle --- examples/associated.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/associated.py b/examples/associated.py index 331fa92..2ee6b79 100644 --- a/examples/associated.py +++ b/examples/associated.py @@ -40,8 +40,8 @@ def _get_zip_scores_files(s): with tempfile.NamedTemporaryFile() as f_zip: shutil.copyfileobj(f_url, f_zip) # Extract the scores file from the zip file - with zipfile.ZipFile(f_zip) as f_zip: - with f_zip.open(scores.path) as f_scores: + with zipfile.ZipFile(f_zip) as zf: + with zf.open(scores.path) as f_scores: # Add scores in the file to our existing System modelcif.reader.read(f_scores, add_to_system=s)