MCPcopy
hub / github.com/prompt-toolkit/ptpython / _compile_with_flags

Method _compile_with_flags

src/ptpython/repl.py:380–388  ·  view source on GitHub ↗

Compile code with the right compiler flags.

(self, code: str, mode: str)

Source from the content-addressed store, hash-verified

378 return super().get_compiler_flags() | PyCF_ALLOW_TOP_LEVEL_AWAIT
379
380 def _compile_with_flags(self, code: str, mode: str) -> Any:
381 "Compile code with the right compiler flags."
382 return compile(
383 code,
384 "<stdin>",
385 mode,
386 flags=self.get_compiler_flags(),
387 dont_inherit=True,
388 )
389
390 def _handle_exception(self, e: BaseException) -> None:
391 # Required for pdb.post_mortem() to work.

Callers 2

evalMethod · 0.95
eval_asyncMethod · 0.95

Calls 1

get_compiler_flagsMethod · 0.95

Tested by

no test coverage detected