Skip to content

Commit b94dbd7

Browse files
authored
bpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736)
1 parent 2b74c83 commit b94dbd7

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Lib/test/test_codeop.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def test_valid(self):
122122
av("def f():\n pass\n#foo\n")
123123
av("@a.b.c\ndef f():\n pass\n")
124124

125-
@support.skip_if_new_parser("Pegen does not support PyCF_DONT_INPLY_DEDENT yet")
126125
def test_incomplete(self):
127126
ai = self.assertIncomplete
128127

Parser/pegen/pegen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ _PyPegen_fill_token(Parser *p)
553553
type = NEWLINE; /* Add an extra newline */
554554
p->parsing_started = 0;
555555

556-
if (p->tok->indent) {
556+
if (p->tok->indent && !(p->flags & PyPARSE_DONT_IMPLY_DEDENT)) {
557557
p->tok->pendin = -p->tok->indent;
558558
p->tok->indent = 0;
559559
}

0 commit comments

Comments
 (0)