From 11dcf13f48a3fd6cb21ad2e96998061d127ac2ff Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 11 May 2023 07:24:02 -0400 Subject: fix: Python3.12 now inlines comprehensions --- coverage/env.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'coverage/env.py') diff --git a/coverage/env.py b/coverage/env.py index bdc2c785..9f9b2553 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -137,6 +137,10 @@ class PYBEHAVIOR: # only a 0-number line, which is ignored, giving a truly empty module. empty_is_empty = (PYVERSION >= (3, 11, 0, "beta", 4)) + # Are comprehensions inlined (new) or compiled as called functions (old)? + # Changed in https://github.com/python/cpython/pull/101441 + comprehensions_are_functions = (PYVERSION <= (3, 12, 0, "alpha", 7, 0)) + # Coverage.py specifics. # Are we using the C-implemented trace function? -- cgit v1.2.1