Skip to content

Commit 5cd0f61

Browse files
committed
Make sure it output ints.
1 parent af36ce7 commit 5cd0f61

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/hunter/util.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,23 @@ def safe_repr(obj, maxdepth=5):
181181
return repr(obj)
182182
elif obj_type is datetime:
183183
return (
184-
f'{obj_type.__name__}({obj.year}, {obj.month}, {obj.day}, {obj.hour}, {obj.minute}, {obj.second}, {obj.microsecond}, '
184+
f'{obj_type.__name__}('
185+
f'{obj.year:d}, '
186+
f'{obj.month:d}, '
187+
f'{obj.day:d}, '
188+
f'{obj.hour:d}, '
189+
f'{obj.minute:d}, '
190+
f'{obj.second:d}, '
191+
f'{obj.microsecond:d}, '
185192
f'tzinfo={safe_repr(obj.tzinfo)}{f", fold={safe_repr(obj.fold)}" if hasattr(obj, "fold") else ""})'
186193
)
187194
elif obj_type is time:
188195
return (
189-
f'{obj_type.__name__}({obj.hour}, {obj.minute}, {obj.second}, {obj.microsecond}, '
196+
f'{obj_type.__name__}('
197+
f'{obj.hour:d}, '
198+
f'{obj.minute:d}, '
199+
f'{obj.second:d}, '
200+
f'{obj.microsecond:d}, '
190201
f'tzinfo={safe_repr(obj.tzinfo)}{f", fold={safe_repr(obj.fold)}" if hasattr(obj, "fold") else ""})'
191202
)
192203
elif obj_type is types.MethodType:

0 commit comments

Comments
 (0)