Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
change list comprehension to for loop with if
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolar committed Oct 12, 2020
1 parent b1501fb commit 10b04b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pype/hooks/tvpaint/prelaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def execute(self, *args, env: dict = None) -> bool:
proj_config_path = os.path.join(
env["PYPE_PROJECT_CONFIGS"], project_name)
if os.path.exists(proj_config_path):
self.log.info(
f"extension: `{extension}`")
template_file = next((
f for f in os.listdir(proj_config_path)
if extension in os.path.splitext(f)[1]
))

template_file = None
for f in os.listdir(proj_config_path):
if extension in os.path.splitext(f):
template_file = f

if template_file:
template_path = os.path.join(
proj_config_path, template_file)
Expand Down

0 comments on commit 10b04b8

Please sign in to comment.