@@ -39,8 +39,8 @@ def get_converter(calendar) -> BaseCalendarConverter:
3939 converter_cls = BaseDateConverter .available_converters ()[
4040 calendar .value .title ()
4141 ]
42- except KeyError :
43- raise ValueError (f"Unknown calendar '{ calendar } '" )
42+ except KeyError as err :
43+ raise ValueError (f"Unknown calendar '{ calendar } '" ) from err
4444 if not issubclass (converter_cls , BaseCalendarConverter ):
4545 raise ValueError (
4646 f"Requested converter '{ calendar .value .title ()} ' is not a CalendarConverter"
@@ -197,9 +197,6 @@ def calculate_earliest_latest(self, year, month, day):
197197 self .earliest = Date (
198198 * self .calendar_converter .to_gregorian (min_year , earliest_month , min_day )
199199 )
200- print (
201- f"initializing latest, year={ max_year } month={ latest_month } day={ max_day } "
202- )
203200 self .latest = Date (
204201 * self .calendar_converter .to_gregorian (max_year , latest_month , max_day )
205202 )
@@ -495,13 +492,12 @@ def possible_years(self) -> list[int] | range:
495492 # convert place to 1, 10, 100, 1000, etc.
496493 step = 10 ** (missing_digit_place - 1 )
497494 return range (earliest_year , latest_year + 1 , step )
498- else : # year is fully unknown
499- # returning range from min year to max year is not useful in any scenario!
500- raise ValueError (
501- "Possible years cannot be returned for completely unknown year"
502- )
503495
504- return [] # shouldn't get here, but mypy complains
496+ # otherwise, year is fully unknown
497+ # returning range from min year to max year is not useful in any scenario!
498+ raise ValueError (
499+ "Possible years cannot be returned for completely unknown year"
500+ )
505501
506502 @property
507503 def representative_years (self ) -> list [int ]:
0 commit comments