Skip to content

Commit 06fd6b3

Browse files
committed
bintime: Fix TimeDelta.__repr__ formatting errors with PyPy
PyPy uses the pure-Python implementation of decimal, _pydecimal.py, which did not support a decimal precision with leading zeros until very recently: python/cpython#130662 Previous behavior: ValueError: Invalid format specifier: .024
1 parent e834b6e commit 06fd6b3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/nitypes/bintime/_timedelta.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def __repr__(self) -> str:
512512
# displayed, the last few are due to rounding error.
513513
return (
514514
f"{self.__class__.__module__}.{self.__class__.__name__}"
515-
f"(Decimal('{self.precision_total_seconds():.024}'))"
515+
f"(Decimal('{self.precision_total_seconds():.24}'))"
516516
)
517517

518518

0 commit comments

Comments
 (0)