File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -358,8 +358,16 @@ pub(crate) fn compile(
358
358
pub ( crate ) use _ast:: NodeAst ;
359
359
// Used by builtins::compile()
360
360
pub const PY_COMPILE_FLAG_AST_ONLY : i32 = 0x0400 ;
361
+
362
+ // The following flags match the values from Include/cpython/compile.h
363
+ // Caveat emptor: These flags are undocumented on purpose and depending
364
+ // on their effect outside the standard library is **unsupported**.
365
+ const PY_CF_DONT_IMPLY_DEDENT : i32 = 0x200 ;
366
+ const PY_CF_ALLOW_INCOMPLETE_INPUT : i32 = 0x4000 ;
367
+
361
368
// Used by builtins::compile() - the summary of all flags
362
- pub const PY_COMPILE_FLAGS_MASK : i32 = PY_COMPILE_FLAG_AST_ONLY ;
369
+ pub const PY_COMPILE_FLAGS_MASK : i32 =
370
+ PY_COMPILE_FLAG_AST_ONLY | PY_CF_DONT_IMPLY_DEDENT | PY_CF_ALLOW_INCOMPLETE_INPUT ;
363
371
364
372
pub fn make_module ( vm : & VirtualMachine ) -> PyRef < PyModule > {
365
373
let module = _ast:: make_module ( vm) ;
You can’t perform that action at this time.
0 commit comments