summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-12-09 01:16:37 (GMT)
committerGitHub <noreply@github.com>2022-12-09 01:16:37 (GMT)
commit3e06b5030b18ca9d9d507423b582d13f38d393f2 (patch)
treee9973fdcdd353ef841da32596279d98060c66283 /Modules
parent1160001b34615066b1188d5fb457131b1ebb928d (diff)
downloadcpython-3e06b5030b18ca9d9d507423b582d13f38d393f2.zip
cpython-3e06b5030b18ca9d9d507423b582d13f38d393f2.tar.gz
cpython-3e06b5030b18ca9d9d507423b582d13f38d393f2.tar.bz2
gh-81057: Fix an ifdef in the time module (#100125)
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. https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Modules')
-rw-r--r--Modules/timemodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index ba4128c..c2bacaa 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -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)
{
@@ -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