Skip to content

Commit

Permalink
fix(folder): Check if subfolder is a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Oct 24, 2022
1 parent 74a4ee7 commit bc16f67
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions honeybee_radiance_folder/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ def _find_files(self, subfolder, pattern, rel_path=True):
rel_path (bool): Return relative path to root folder.
"""
folder = os.path.join(self.folder, subfolder)
filtered_files = [
self._as_posix(os.path.normpath(os.path.join(folder, f)))
for f in os.listdir(folder)
if re.search(pattern, f)
]
if os.path.isdir(folder):
filtered_files = [
self._as_posix(os.path.normpath(os.path.join(folder, f)))
for f in os.listdir(folder)
if re.search(pattern, f)
]
else:
filtered_files = []

if rel_path:
# FIX relative path
Expand Down

0 comments on commit bc16f67

Please sign in to comment.