Skip to content

Commit c4e3957

Browse files
authored
Fix internal usage of deprecated and imprecise Duration constructor (#1033)
1 parent b8b9e16 commit c4e3957

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

neo4j/time/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,10 @@ def __mod__(self, other):
515515
# )
516516
seconds = self[2] + Decimal(self[3]) / NANO_SECONDS
517517
seconds, subseconds = symmetric_divmod(seconds % other, 1)
518+
ns = subseconds * NANO_SECONDS
518519
return Duration(months=round_half_to_even(self[0] % other),
519520
days=round_half_to_even(self[1] % other),
520-
seconds=seconds, subseconds=subseconds)
521+
seconds=seconds, nanoseconds=ns)
521522
return NotImplemented
522523

523524
@deprecated("Will be removed in 5.0.")

0 commit comments

Comments
 (0)