Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7891f12

Browse files
authored
fix(decorators-2.py): .datetime.utcnow() is deprecated replace with .datetime.utcnow()
1 parent 2681e1b commit 7891f12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

08.Decorators/decorators-2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
def my_decorator(inner):
1111
def inner_decorator():
12-
print(datetime.datetime.utcnow())
12+
print(datetime.now(datetime.UTC))
1313
inner()
14-
print(datetime.datetime.utcnow())
14+
print(datetime.now(datetime.UTC))
1515

1616
return inner_decorator
1717

@@ -30,4 +30,4 @@ def decorated():
3030
2022-07-16 12:24:18.704572
3131
This happened!
3232
2022-07-16 12:24:18.704572
33-
'''
33+
'''

0 commit comments

Comments
 (0)