Skip to content

Commit

Permalink
python: ensure tv_sec is assigned only int (for python 3.10)
Browse files Browse the repository at this point in the history
  • Loading branch information
natoscott committed Oct 24, 2024
1 parent b34f667 commit 853c65b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/python/pcp/pmapi.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ class timeval(Structure):
sec = float((sec - epoch).total_seconds())
if isinstance(sec, float):
ts = modf(sec)
sec = int(ts[1])
usec = int(ts[0] * 1000000)
sec = ts[1]
usec = ts[0] * 1000000
else:
usec = 0
self.tv_sec = sec
self.tv_usec = usec
self.tv_sec = int(sec)
self.tv_usec = int(usec)

@classmethod
def fromInterval(cls, interval):
Expand Down

0 comments on commit 853c65b

Please sign in to comment.