Skip to content

Commit

Permalink
Add missing string formatter to ZoneInfoNotFoundError (#129)
Browse files Browse the repository at this point in the history
Previously there was a string interpolation sign (%s) but nothing
was being added. This change adds tzenv to give a better error message.
  • Loading branch information
CalebJohn authored Jun 2, 2022
1 parent 0b24ac3 commit c2b71e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changes
4.3 (unreleased)
----------------

- Nothing changed yet.
- Improved the error message when the ZoneInfo cannot be found


4.2 (2022-04-02)
Expand Down
2 changes: 1 addition & 1 deletion tzlocal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ def _tz_from_env(tzenv=None):
# Nope, it's something like "PST4DST" etc, we can't handle that.
raise ZoneInfoNotFoundError(
"tzlocal() does not support non-zoneinfo timezones like %s. \n"
"Please use a timezone in the form of Continent/City"
"Please use a timezone in the form of Continent/City" % tzenv
) from None

0 comments on commit c2b71e9

Please sign in to comment.