@@ -508,7 +508,7 @@ parser_do_parse(PyObject *args, PyObject *kw, char *argspec, int type)
508
508
if (n != 0 )
509
509
res = parser_newastobject (n , type );
510
510
else
511
- err_string ("Could not parse string. " );
511
+ err_string ("could not parse string" );
512
512
}
513
513
return (res );
514
514
}
@@ -611,14 +611,14 @@ parser_tuple2ast(PyAST_Object *self, PyObject *args, PyObject *kw)
611
611
else {
612
612
/* This is a fragment, at best. */
613
613
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" );
615
615
}
616
616
}
617
617
/* Make sure we throw an exception on all errors. We should never
618
618
* get this, but we'd do well to be sure something is done.
619
619
*/
620
620
if ((ast == 0 ) && !PyErr_Occurred ())
621
- err_string ("Unspecified ast error occurred. " );
621
+ err_string ("unspecified AST error occurred" );
622
622
623
623
return (ast );
624
624
}
@@ -670,16 +670,16 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
670
670
PyObject * temp ;
671
671
672
672
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" );
674
674
return 0 ;
675
675
}
676
676
temp = PySequence_GetItem (elem , 1 );
677
677
if (temp == NULL )
678
678
return 0 ;
679
679
if (!PyString_Check (temp )) {
680
680
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" ,
683
683
((PyTypeObject * )PyObject_Type (temp ))-> tp_name );
684
684
Py_DECREF (temp );
685
685
return 0 ;
@@ -691,8 +691,8 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
691
691
* line_num = PyInt_AS_LONG (o );
692
692
else {
693
693
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" ,
696
696
((PyTypeObject * )PyObject_Type (temp ))-> tp_name );
697
697
Py_DECREF (o );
698
698
Py_DECREF (temp );
@@ -713,7 +713,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
713
713
* Throw an exception.
714
714
*/
715
715
PyErr_SetObject (parser_error ,
716
- Py_BuildValue ("os" , elem , "Unknown node type." ));
716
+ Py_BuildValue ("os" , elem , "unknown node type." ));
717
717
Py_XDECREF (elem );
718
718
return (0 );
719
719
}
@@ -1566,7 +1566,7 @@ validate_dotted_as_name(node *tree)
1566
1566
&& validate_name (CHILD (tree , 2 ), NULL ));
1567
1567
else {
1568
1568
res = 0 ;
1569
- err_string ("Illegal number of children for dotted_as_name. " );
1569
+ err_string ("illegal number of children for dotted_as_name" );
1570
1570
}
1571
1571
}
1572
1572
return res ;
@@ -1655,7 +1655,7 @@ validate_exec_stmt(node *tree)
1655
1655
&& validate_expr (CHILD (tree , 1 )));
1656
1656
1657
1657
if (!res && !PyErr_Occurred ())
1658
- err_string ("Illegal exec statement. " );
1658
+ err_string ("illegal exec statement" );
1659
1659
if (res && (nch > 2 ))
1660
1660
res = (validate_name (CHILD (tree , 2 ), "in" )
1661
1661
&& validate_test (CHILD (tree , 3 )));
@@ -1682,7 +1682,7 @@ validate_assert_stmt(node *tree)
1682
1682
&& validate_test (CHILD (tree , 1 )));
1683
1683
1684
1684
if (!res && !PyErr_Occurred ())
1685
- err_string ("Illegal assert statement. " );
1685
+ err_string ("illegal assert statement" );
1686
1686
if (res && (nch > 2 ))
1687
1687
res = (validate_comma (CHILD (tree , 2 ))
1688
1688
&& validate_test (CHILD (tree , 3 )));
@@ -1778,7 +1778,7 @@ validate_try(node *tree)
1778
1778
res = ((strcmp (STR (CHILD (tree , pos )), "except" ) == 0 )
1779
1779
|| (strcmp (STR (CHILD (tree , pos )), "else" ) == 0 ));
1780
1780
if (!res )
1781
- err_string ("Illegal trailing triple in try statement. " );
1781
+ err_string ("illegal trailing triple in try statement" );
1782
1782
}
1783
1783
else if (nch == (pos + 6 )) {
1784
1784
res = (validate_name (CHILD (tree , pos ), "except" )
@@ -1912,11 +1912,11 @@ validate_comp_op(node *tree)
1912
1912
|| (strcmp (STR (tree ), "is" ) == 0 ));
1913
1913
if (!res ) {
1914
1914
PyErr_Format (parser_error ,
1915
- "Illegal operator: '%s'. " , STR (tree ));
1915
+ "illegal operator '%s'" , STR (tree ));
1916
1916
}
1917
1917
break ;
1918
1918
default :
1919
- err_string ("Illegal comparison operator type. " );
1919
+ err_string ("illegal comparison operator type" );
1920
1920
break ;
1921
1921
}
1922
1922
}
@@ -1928,7 +1928,7 @@ validate_comp_op(node *tree)
1928
1928
|| ((strcmp (STR (CHILD (tree , 0 )), "not" ) == 0 )
1929
1929
&& (strcmp (STR (CHILD (tree , 1 )), "in" ) == 0 ))));
1930
1930
if (!res && !PyErr_Occurred ())
1931
- err_string ("Unknown comparison operator. " );
1931
+ err_string ("unknown comparison operator" );
1932
1932
}
1933
1933
return (res );
1934
1934
}
@@ -2075,7 +2075,7 @@ validate_power(node *tree)
2075
2075
res = validate_trailer (CHILD (tree , pos ++ ));
2076
2076
if (res && (pos < nch )) {
2077
2077
if (!is_even (nch - pos )) {
2078
- err_string ("Illegal number of nodes for 'power'. " );
2078
+ err_string ("illegal number of nodes for 'power'" );
2079
2079
return (0 );
2080
2080
}
2081
2081
for ( ; res && (pos < (nch - 1 )); pos += 2 )
@@ -2532,7 +2532,7 @@ validate_node(node *tree)
2532
2532
if (res )
2533
2533
next = CHILD (tree , 0 );
2534
2534
else if (nch == 1 )
2535
- err_string ("Illegal flow_stmt type. " );
2535
+ err_string ("illegal flow_stmt type" );
2536
2536
break ;
2537
2537
/*
2538
2538
* Compound statements.
@@ -2654,7 +2654,7 @@ validate_node(node *tree)
2654
2654
2655
2655
default :
2656
2656
/* Hopefully never reached! */
2657
- err_string ("Unrecogniged node type. " );
2657
+ err_string ("unrecognized node type" );
2658
2658
res = 0 ;
2659
2659
break ;
2660
2660
}
@@ -2670,7 +2670,7 @@ validate_expr_tree(node *tree)
2670
2670
int res = validate_eval_input (tree );
2671
2671
2672
2672
if (!res && !PyErr_Occurred ())
2673
- err_string ("Could not validate expression tuple. " );
2673
+ err_string ("could not validate expression tuple" );
2674
2674
2675
2675
return (res );
2676
2676
}
@@ -2698,7 +2698,7 @@ validate_file_input(node *tree)
2698
2698
* this, we have some debugging to do.
2699
2699
*/
2700
2700
if (!res && !PyErr_Occurred ())
2701
- err_string ("VALIDATION FAILURE: report this to the maintainer!. " );
2701
+ err_string ("VALIDATION FAILURE: report this to the maintainer!" );
2702
2702
2703
2703
return (res );
2704
2704
}
0 commit comments