Skip to content

Commit e8925df

Browse files
fix: strip _year suffix from day in clean_day
1 parent fc47a76 commit e8925df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/adventofcode/util/module_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ def clean_year(year_path: str) -> int:
4141

4242
def clean_day(day_file: str) -> int:
4343
"""
44-
Removes the 'day_' prefix and .py extension from the day file
44+
Removes the 'day_' prefix, _year suffix and .py extension from the day file
4545
"""
4646
segments = day_file.split(os.sep)
4747
day_segment = segments[-1].replace('.py', '')
48-
return int(day_segment[4:])
48+
49+
return int(day_segment[4:-5])
4950

5051

5152
def year_dir_from_path(year_dir: str) -> str:

0 commit comments

Comments
 (0)