[Python-checkins] Update error message in _zoneinfo.py to use f-string (GH-20577)

aboddie webhook-mailer at python.org
Wed Jun 3 10:18:23 EDT 2020


https://github.com/python/cpython/commit/5b9fbbabacca0378755fd9cadc4a7cc01a71eaef
commit: 5b9fbbabacca0378755fd9cadc4a7cc01a71eaef
branch: master
author: aboddie <64019758+aboddie at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-06-03T07:18:19-07:00
summary:

Update error message in _zoneinfo.py to use f-string (GH-20577)



Inline with the rest of the file, updated error message to use f-string.

files:
M Lib/zoneinfo/_zoneinfo.py

diff --git a/Lib/zoneinfo/_zoneinfo.py b/Lib/zoneinfo/_zoneinfo.py
index 7b1718a0676e1..9810637d3ef65 100644
--- a/Lib/zoneinfo/_zoneinfo.py
+++ b/Lib/zoneinfo/_zoneinfo.py
@@ -742,7 +742,7 @@ def _parse_tz_delta(tz_delta):
 
     if not -86400 < total < 86400:
         raise ValueError(
-            "Offset must be strictly between -24h and +24h:" + tz_delta
+            f"Offset must be strictly between -24h and +24h: {tz_delta}"
         )
 
     # Yes, +5 maps to an offset of -5h



More information about the Python-checkins mailing list