Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 185c7ac

Browse files
Kab1rpganssle
authored andcommitted
fix(datetime): move datetime.UTC definition to end to ensure that it is an alias
1 parent 7335f0a commit 185c7ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/datetime.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2290,7 +2290,8 @@ def _name_from_offset(delta):
22902290
return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'
22912291
return f'UTC{sign}{hours:02d}:{minutes:02d}'
22922292

2293-
UTC = timezone.utc = timezone._create(timedelta(0))
2293+
timezone.utc = timezone._create(timedelta(0))
2294+
22942295
# bpo-37642: These attributes are rounded to the nearest minute for backwards
22952296
# compatibility, even though the constructor will accept a wider range of
22962297
# values. This may change in the future.
@@ -2514,3 +2515,5 @@ def _name_from_offset(delta):
25142515
# appropriate to maintain a single module level docstring and
25152516
# remove the following line.
25162517
from _datetime import __doc__
2518+
2519+
UTC = timezone.utc

0 commit comments

Comments
 (0)