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

Commit 65be24b

Browse files
authored
fix(decorators-3.py): datetime.utcnow() is deprecated replace with .datetime.utcnow()
1 parent 7891f12 commit 65be24b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

08.Decorators/decorators-3.py

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

1313
def my_decorator(inner):
1414
def inner_decorator(num_copy):
15-
print(datetime.datetime.utcnow())
15+
print(datetime.now(datetime.UTC))
1616
inner(int(num_copy) + 1)
17-
print(datetime.datetime.utcnow())
17+
print(datetime.now(datetime.UTC))
1818

1919
return inner_decorator
2020

@@ -32,4 +32,4 @@ def decorated(number):
3232
2022-07-16 12:26:14.060603
3333
This happened : 6
3434
2022-07-16 12:26:14.060603
35-
'''
35+
'''

0 commit comments

Comments
 (0)