From 15205e11fa132e076f992bfdbad2dd95894d2216 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Sat, 28 Aug 2021 00:53:59 +0200 Subject: simplify assignment and add comment explaining its purpose --- bot/exts/info/tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/exts/info/tags.py b/bot/exts/info/tags.py index 91046c654..931c01e3a 100644 --- a/bot/exts/info/tags.py +++ b/bot/exts/info/tags.py @@ -146,9 +146,9 @@ class Tags(Cog): for file in base_path.glob("**/*"): if file.is_file(): parent_dir = file.relative_to(base_path).parent - tag_name = file.stem - tag_group = parent_dir.name if parent_dir.name else None + # Files directly under `base_path` have an empty string as the parent directory name + tag_group = parent_dir.name or None self.tags[TagIdentifier(tag_group, tag_name)] = Tag(file) -- cgit v1.2.3