Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c41778

Browse files
committed
Fix bug in input(); add comments to cases in compile().
1 parent 86cd6e6 commit 4c41778

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

Python/compile.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ compile_node(c, n)
16801680

16811681
switch (TYPE(n)) {
16821682

1683-
case single_input:
1683+
case single_input: /* One interactive command */
16841684
/* NEWLINE | simple_stmt | compound_stmt NEWLINE */
16851685
com_addbyte(c, REFUSE_ARGS);
16861686
n = CHILD(n, 0);
@@ -1690,31 +1690,30 @@ compile_node(c, n)
16901690
com_addbyte(c, RETURN_VALUE);
16911691
break;
16921692

1693-
case file_input:
1693+
case file_input: /* A whole file, or built-in function exec() */
16941694
com_addbyte(c, REFUSE_ARGS);
16951695
com_file_input(c, n);
16961696
com_addoparg(c, LOAD_CONST, com_addconst(c, None));
16971697
com_addbyte(c, RETURN_VALUE);
16981698
break;
16991699

1700-
case expr_input:
1700+
case expr_input: /* Built-in function eval() */
17011701
com_addbyte(c, REFUSE_ARGS);
17021702
com_node(c, CHILD(n, 0));
1703-
com_addoparg(c, LOAD_CONST, com_addconst(c, None));
17041703
com_addbyte(c, RETURN_VALUE);
17051704
break;
17061705

1707-
case eval_input:
1706+
case eval_input: /* Built-in function input() */
17081707
com_addbyte(c, REFUSE_ARGS);
17091708
com_node(c, CHILD(n, 0));
17101709
com_addbyte(c, RETURN_VALUE);
17111710
break;
17121711

1713-
case funcdef:
1712+
case funcdef: /* A function definition */
17141713
compile_funcdef(c, n);
17151714
break;
17161715

1717-
case classdef:
1716+
case classdef: /* A class definition */
17181717
/* 'class' NAME parameters ['=' baselist] ':' suite */
17191718
com_addbyte(c, REFUSE_ARGS);
17201719
com_node(c, CHILD(n, NCH(n)-1));

0 commit comments

Comments
 (0)