Skip to content

Commit 10dfe1d

Browse files
committed
Use _PyTime_FromNanosecondsObject
1 parent a7ae3b9 commit 10dfe1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/_lsprof.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ static _PyTime_t CallExternalTimer(ProfilerObject *pObj)
7272
if (pObj->externalTimerUnit > 0.0) {
7373
/* interpret the result as an integer that will be scaled
7474
in profiler_getstats() */
75-
result = (_PyTime_t)PyLong_AsLongLong(o);
75+
(void)_PyTime_FromNanosecondsObject(&result, o);
76+
// Error is checked below.
7677
}
7778
else {
7879
/* interpret the result as a double measured in seconds.

0 commit comments

Comments
 (0)