@@ -508,7 +508,7 @@ parser_do_parse(PyObject *args, PyObject *kw, char *argspec, int type)
508508 if (n != 0 )
509509 res = parser_newastobject (n , type );
510510 else
511- err_string ("Could not parse string. " );
511+ err_string ("could not parse string" );
512512 }
513513 return (res );
514514}
@@ -611,14 +611,14 @@ parser_tuple2ast(PyAST_Object *self, PyObject *args, PyObject *kw)
611611 else {
612612 /* This is a fragment, at best. */
613613 PyNode_Free (tree );
614- err_string ("Parse tree does not use a valid start symbol. " );
614+ err_string ("parse tree does not use a valid start symbol" );
615615 }
616616 }
617617 /* Make sure we throw an exception on all errors. We should never
618618 * get this, but we'd do well to be sure something is done.
619619 */
620620 if ((ast == 0 ) && !PyErr_Occurred ())
621- err_string ("Unspecified ast error occurred. " );
621+ err_string ("unspecified AST error occurred" );
622622
623623 return (ast );
624624}
@@ -670,16 +670,16 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
670670 PyObject * temp ;
671671
672672 if ((len != 2 ) && (len != 3 )) {
673- err_string ("Terminal nodes must have 2 or 3 entries. " );
673+ err_string ("terminal nodes must have 2 or 3 entries" );
674674 return 0 ;
675675 }
676676 temp = PySequence_GetItem (elem , 1 );
677677 if (temp == NULL )
678678 return 0 ;
679679 if (!PyString_Check (temp )) {
680680 PyErr_Format (parser_error ,
681- "Second item in terminal node must be a string,"
682- " found %s. " ,
681+ "second item in terminal node must be a string,"
682+ " found %s" ,
683683 ((PyTypeObject * )PyObject_Type (temp ))-> tp_name );
684684 Py_DECREF (temp );
685685 return 0 ;
@@ -691,8 +691,8 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
691691 * line_num = PyInt_AS_LONG (o );
692692 else {
693693 PyErr_Format (parser_error ,
694- "Third item in terminal node must be an"
695- " integer, found %s. " ,
694+ "third item in terminal node must be an"
695+ " integer, found %s" ,
696696 ((PyTypeObject * )PyObject_Type (temp ))-> tp_name );
697697 Py_DECREF (o );
698698 Py_DECREF (temp );
@@ -713,7 +713,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
713713 * Throw an exception.
714714 */
715715 PyErr_SetObject (parser_error ,
716- Py_BuildValue ("os" , elem , "Unknown node type." ));
716+ Py_BuildValue ("os" , elem , "unknown node type." ));
717717 Py_XDECREF (elem );
718718 return (0 );
719719 }
@@ -1566,7 +1566,7 @@ validate_dotted_as_name(node *tree)
15661566 && validate_name (CHILD (tree , 2 ), NULL ));
15671567 else {
15681568 res = 0 ;
1569- err_string ("Illegal number of children for dotted_as_name. " );
1569+ err_string ("illegal number of children for dotted_as_name" );
15701570 }
15711571 }
15721572 return res ;
@@ -1655,7 +1655,7 @@ validate_exec_stmt(node *tree)
16551655 && validate_expr (CHILD (tree , 1 )));
16561656
16571657 if (!res && !PyErr_Occurred ())
1658- err_string ("Illegal exec statement. " );
1658+ err_string ("illegal exec statement" );
16591659 if (res && (nch > 2 ))
16601660 res = (validate_name (CHILD (tree , 2 ), "in" )
16611661 && validate_test (CHILD (tree , 3 )));
@@ -1682,7 +1682,7 @@ validate_assert_stmt(node *tree)
16821682 && validate_test (CHILD (tree , 1 )));
16831683
16841684 if (!res && !PyErr_Occurred ())
1685- err_string ("Illegal assert statement. " );
1685+ err_string ("illegal assert statement" );
16861686 if (res && (nch > 2 ))
16871687 res = (validate_comma (CHILD (tree , 2 ))
16881688 && validate_test (CHILD (tree , 3 )));
@@ -1778,7 +1778,7 @@ validate_try(node *tree)
17781778 res = ((strcmp (STR (CHILD (tree , pos )), "except" ) == 0 )
17791779 || (strcmp (STR (CHILD (tree , pos )), "else" ) == 0 ));
17801780 if (!res )
1781- err_string ("Illegal trailing triple in try statement. " );
1781+ err_string ("illegal trailing triple in try statement" );
17821782 }
17831783 else if (nch == (pos + 6 )) {
17841784 res = (validate_name (CHILD (tree , pos ), "except" )
@@ -1912,11 +1912,11 @@ validate_comp_op(node *tree)
19121912 || (strcmp (STR (tree ), "is" ) == 0 ));
19131913 if (!res ) {
19141914 PyErr_Format (parser_error ,
1915- "Illegal operator: '%s'. " , STR (tree ));
1915+ "illegal operator '%s'" , STR (tree ));
19161916 }
19171917 break ;
19181918 default :
1919- err_string ("Illegal comparison operator type. " );
1919+ err_string ("illegal comparison operator type" );
19201920 break ;
19211921 }
19221922 }
@@ -1928,7 +1928,7 @@ validate_comp_op(node *tree)
19281928 || ((strcmp (STR (CHILD (tree , 0 )), "not" ) == 0 )
19291929 && (strcmp (STR (CHILD (tree , 1 )), "in" ) == 0 ))));
19301930 if (!res && !PyErr_Occurred ())
1931- err_string ("Unknown comparison operator. " );
1931+ err_string ("unknown comparison operator" );
19321932 }
19331933 return (res );
19341934}
@@ -2075,7 +2075,7 @@ validate_power(node *tree)
20752075 res = validate_trailer (CHILD (tree , pos ++ ));
20762076 if (res && (pos < nch )) {
20772077 if (!is_even (nch - pos )) {
2078- err_string ("Illegal number of nodes for 'power'. " );
2078+ err_string ("illegal number of nodes for 'power'" );
20792079 return (0 );
20802080 }
20812081 for ( ; res && (pos < (nch - 1 )); pos += 2 )
@@ -2532,7 +2532,7 @@ validate_node(node *tree)
25322532 if (res )
25332533 next = CHILD (tree , 0 );
25342534 else if (nch == 1 )
2535- err_string ("Illegal flow_stmt type. " );
2535+ err_string ("illegal flow_stmt type" );
25362536 break ;
25372537 /*
25382538 * Compound statements.
@@ -2654,7 +2654,7 @@ validate_node(node *tree)
26542654
26552655 default :
26562656 /* Hopefully never reached! */
2657- err_string ("Unrecogniged node type. " );
2657+ err_string ("unrecognized node type" );
26582658 res = 0 ;
26592659 break ;
26602660 }
@@ -2670,7 +2670,7 @@ validate_expr_tree(node *tree)
26702670 int res = validate_eval_input (tree );
26712671
26722672 if (!res && !PyErr_Occurred ())
2673- err_string ("Could not validate expression tuple. " );
2673+ err_string ("could not validate expression tuple" );
26742674
26752675 return (res );
26762676}
@@ -2698,7 +2698,7 @@ validate_file_input(node *tree)
26982698 * this, we have some debugging to do.
26992699 */
27002700 if (!res && !PyErr_Occurred ())
2701- err_string ("VALIDATION FAILURE: report this to the maintainer!. " );
2701+ err_string ("VALIDATION FAILURE: report this to the maintainer!" );
27022702
27032703 return (res );
27042704}
0 commit comments