Skip to content

Commit 034cec6

Browse files
committed
Get the REPL working with Python 3.14 again
A recent change (python/cpython#132450) necessitates this.
1 parent f867488 commit 034cec6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hy/repl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ def _cmdline_checkcache(*args):
7878

7979

8080
_codeop_maybe_compile = codeop._maybe_compile
81-
codeop._maybe_compile = (lambda compiler, source, filename, symbol:
81+
codeop._maybe_compile = (lambda compiler, source, filename, symbol, *args, **kwargs:
82+
# Python 3.14 adds a mandatory parameter `flags`, which is
83+
# sometimes specified by position and sometimes by name.
8284
compiler(source, filename, symbol)
8385
if isinstance(compiler, HyCompile) else
84-
_codeop_maybe_compile(compiler, source, filename, symbol))
86+
_codeop_maybe_compile(compiler, source, filename, symbol, *args, **kwargs))
8587

8688

8789
class HyCompile(codeop.Compile):

0 commit comments

Comments
 (0)