Skip to content

Commit 56da1fc

Browse files
Remove Python < 3.7 timezone workaround in _rfc3339.py
Python 3.7+ supports %z with colons in timezone offsets. Since this project now requires Python >= 3.9, the regex substitution to remove colons from timezone offsets is no longer necessary and can be removed. Co-authored-by: lahirumaramba <55609+lahirumaramba@users.noreply.github.com>
1 parent d11b211 commit 56da1fc

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

firebase_admin/_rfc3339.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ def _parse_to_datetime(datestr):
6868
except ValueError:
6969
pass
7070

71-
# Note: %z parses timezone offsets, but requires the timezone offset *not*
72-
# include a separating ':'. As of python 3.7, this was relaxed.
73-
# TODO(rsgowman): Once python3.7 becomes our floor, we can drop the regex
74-
# replacement.
75-
datestr_modified = re.sub(r'(\d\d):(\d\d)$', r'\1\2', datestr_modified)
76-
7771
try:
7872
return datetime.strptime(datestr_modified, '%Y-%m-%dT%H:%M:%S.%f%z')
7973
except ValueError:

0 commit comments

Comments
 (0)