From 3bc4d256fe4a1af1368906d1af8bab8f5e4cad2a Mon Sep 17 00:00:00 2001 From: Dave Chen Date: Tue, 27 Aug 2024 12:26:14 -0400 Subject: [PATCH] Tweak pylint change; IOError -> OSError --- dicom2stl/utils/dicomutils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dicom2stl/utils/dicomutils.py b/dicom2stl/utils/dicomutils.py index 063c7d1..ff1bad6 100755 --- a/dicom2stl/utils/dicomutils.py +++ b/dicom2stl/utils/dicomutils.py @@ -39,14 +39,12 @@ def scanDirForDicom(dicomdir): matches = [] found_dirs = [] try: - for walk_output in os.walk(dicomdir): - root = walk_output[0] - filenames = walk_output[2] + for root, _, filenames in os.walk(dicomdir): for filename in fnmatch.filter(filenames, "*.dcm"): matches.append(os.path.join(root, filename)) if root not in found_dirs: found_dirs.append(root) - except IOError as e: + except OSError as e: print("Error in scanDirForDicom: ", e) print("dicomdir = ", dicomdir)