jaraco / tempora

MIT License
20 stars 5 forks source link

Avoid use of `datetime.utc*` deprecated in Python 3.12 #24

Closed scop closed 1 year ago

scop commented 1 year ago
scop commented 1 year ago

TBH, I suppose DST changes don't actually play much of a role in this assuming a correctly set up system. But the monotonic time value exists specifically for cases like this one, https://peps.python.org/pep-0418/ mentions manual and NTP adjustments.

Switching to monotonic would imply some internal changes how elapsed is constructed, but I recognized that needs to stay a timedelta and it sure can. I just didn't want to start modifying too much; I'm not actually even using tempora (directly/that I know of), but just sent a few related PR's to projects in Home Assistant's dependency chain.

jaraco commented 1 year ago

This is great. Before the changes, there are 259 warnings. After the change, 252 warnings (and none in tempora).

jaraco commented 1 year ago

Releasing as v5.3.0.