File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 2
2
Changelog
3
3
=========
4
4
5
+ * Fix ``utcfromtimestamp() `` warning on Python 3.12+.
6
+
7
+ Thanks to Konstantin Baikov in `PR #424 <https://github.com/adamchainz/time-machine/pull/424 >`__.
8
+
5
9
* Avoid calling deprecated ``uuid._load_system_functions() `` on Python 3.9+.
6
10
7
11
Thanks to Nikita Sobolev for the ping in `CPython Issue #113308 <https://github.com/python/cpython/issues/113308 >`__.
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ def utcnow() -> dt.datetime:
350
350
if not coordinates_stack :
351
351
result : dt .datetime = _time_machine .original_utcnow ()
352
352
return result
353
- return dt .datetime .utcfromtimestamp (time ())
353
+ return dt .datetime .fromtimestamp (time (), dt . timezone . utc ). replace ( tzinfo = None )
354
354
355
355
356
356
# time module
You can’t perform that action at this time.
0 commit comments