Skip to content

Commit

Permalink
gh-81057: Fix an ifdef in the time module (#100125)
Browse files Browse the repository at this point in the history
An earlier commit only defined check_ticks_per_second() when HAVE_TIMES is defined. However, we also need it when HAVE_CLOCK is defined. This primarily affects Windows.

#81057
  • Loading branch information
ericsnowcurrently committed Dec 9, 2022
1 parent 1160001 commit 3e06b50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Modules/timemodule.c
Expand Up @@ -62,8 +62,7 @@
#define SEC_TO_NS (1000 * 1000 * 1000)


#ifdef HAVE_TIMES

#if defined(HAVE_TIMES) || defined(HAVE_CLOCK)
static int
check_ticks_per_second(long tps, const char *context)
{
Expand All @@ -75,6 +74,9 @@ check_ticks_per_second(long tps, const char *context)
}
return 0;
}
#endif /* HAVE_TIMES || HAVE_CLOCK */

#ifdef HAVE_TIMES

# define ticks_per_second _PyRuntime.time.ticks_per_second

Expand Down

0 comments on commit 3e06b50

Please sign in to comment.