python-utils 4.1.1__py3-none-any.whl → 4.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_utils/formatters.py +7 -0
- {python_utils-4.1.1.dist-info → python_utils-4.1.2.dist-info}/METADATA +1 -1
- {python_utils-4.1.1.dist-info → python_utils-4.1.2.dist-info}/RECORD +5 -5
- {python_utils-4.1.1.dist-info → python_utils-4.1.2.dist-info}/WHEEL +0 -0
- {python_utils-4.1.1.dist-info → python_utils-4.1.2.dist-info}/licenses/LICENSE +0 -0
python_utils/formatters.py
CHANGED
|
@@ -155,6 +155,13 @@ def timesince(
|
|
|
155
155
|
# A date has no `tzinfo`, and no time to subtract either. It gets
|
|
156
156
|
# the same `TypeError` from the subtraction as it always did.
|
|
157
157
|
now = datetime.datetime.now(getattr(dt, 'tzinfo', None))
|
|
158
|
+
if now.utcoffset() is not None:
|
|
159
|
+
# Two aware datetimes that share a tzinfo subtract by wall clock,
|
|
160
|
+
# which misses a daylight saving change between them. The current
|
|
161
|
+
# time in UTC counts it. Only `now` is converted, because
|
|
162
|
+
# converting `dt` could overflow near `datetime.min` or
|
|
163
|
+
# `datetime.max`.
|
|
164
|
+
now = now.astimezone(datetime.timezone.utc)
|
|
158
165
|
diff = abs(now - dt)
|
|
159
166
|
|
|
160
167
|
# Every unit takes its share from what the larger units left over, so a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-utils
|
|
3
|
-
Version: 4.1.
|
|
3
|
+
Version: 4.1.2
|
|
4
4
|
Summary: Python Utils is a module with some convenient utilities not included with the standard Python install
|
|
5
5
|
Keywords: utils,utilities,helpers,typing,typed,async,lazy-imports
|
|
6
6
|
Author: Rick van Hattem
|
|
@@ -6,7 +6,7 @@ python_utils/containers.py,sha256=kHpDgj_sAdoouL0b_CE6IHSd-qtz0KYMs_Nuiba-yEQ,37
|
|
|
6
6
|
python_utils/converters.py,sha256=gBOjkVYGwx1aBs7OtjFrMdQgZwI6wbOU_Rvy0u9OVFE,17273
|
|
7
7
|
python_utils/decorators.py,sha256=UyVuV7Phf8kjAt38uA-F9MFH2o8zM4t-fmlgt3KL5cc,8225
|
|
8
8
|
python_utils/exceptions.py,sha256=B5wljs3Id6eQ9eRaur-ZMPGGmhHNwh9F08Sfw6fuLX4,1230
|
|
9
|
-
python_utils/formatters.py,sha256=
|
|
9
|
+
python_utils/formatters.py,sha256=rvbeP7H3h8Hll573PZkWsJPuHETjEHpWleb0tFck8MM,7031
|
|
10
10
|
python_utils/generators.py,sha256=5X2mbjkEWl69syOHTxUaQS18ILZ49n2EvXb4cASVjxg,6151
|
|
11
11
|
python_utils/import_.py,sha256=EnVSLs7Sk1CHrkpiKdXe8i-O6XjS5hXINpjdEohRT4A,5541
|
|
12
12
|
python_utils/logger.py,sha256=-QuF7Zfo7pxc4nTmAPc9Pm-oz5wsxXIX7NeCnYEPI6I,14043
|
|
@@ -15,7 +15,7 @@ python_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
15
15
|
python_utils/terminal.py,sha256=GL3n2_rT98LBNmxy-amY-hezGKStCo-9_d_pR-TMgv8,6823
|
|
16
16
|
python_utils/time.py,sha256=fZz00bpTeLXFFhbAo03LiMLWuzSJU4iPbyGSe7PYshU,16979
|
|
17
17
|
python_utils/types.py,sha256=N1O2uFE2IuwVJk_vcwz8XNkf-taL-vJ5iNNG6FUXjTg,4336
|
|
18
|
-
python_utils-4.1.
|
|
19
|
-
python_utils-4.1.
|
|
20
|
-
python_utils-4.1.
|
|
21
|
-
python_utils-4.1.
|
|
18
|
+
python_utils-4.1.2.dist-info/licenses/LICENSE,sha256=_Zrs9NZu-G6_aZT2g3Jv5_JREJQfhRNBC61EH6WDH-o,1501
|
|
19
|
+
python_utils-4.1.2.dist-info/WHEEL,sha256=xTCBFIZIIyRSxyowOv5Wqg_jFU6KsdIffuulBB09Ph8,80
|
|
20
|
+
python_utils-4.1.2.dist-info/METADATA,sha256=3J5FcPBoGz3GUwBqrVVMQ7sCImyan0jHGI3i_2UK-os,15988
|
|
21
|
+
python_utils-4.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|