@@ -323,7 +323,7 @@ def emit(s, depth=0, reflow=True):
323
323
if not opt and argtype != "int" :
324
324
emit ("if (!%s) {" % argname , 1 )
325
325
emit ("PyErr_SetString(PyExc_ValueError," , 2 )
326
- msg = "field %s is required for %s" % (argname , name )
326
+ msg = "field '%s' is required for %s" % (argname , name )
327
327
emit (' "%s");' % msg ,
328
328
2 , reflow = False )
329
329
emit ('return NULL;' , 2 )
@@ -853,11 +853,9 @@ def visitModule(self, mod):
853
853
Py_INCREF((PyObject*)o);
854
854
return (PyObject*)o;
855
855
}
856
- #define ast2obj_singleton ast2obj_object
857
856
#define ast2obj_constant ast2obj_object
858
857
#define ast2obj_identifier ast2obj_object
859
858
#define ast2obj_string ast2obj_object
860
- #define ast2obj_bytes ast2obj_object
861
859
862
860
static PyObject* ast2obj_int(long b)
863
861
{
@@ -1147,12 +1145,8 @@ def simpleSum(self, sum, name):
1147
1145
self .emit ("case %s:" % t .name , 2 )
1148
1146
self .emit ("Py_INCREF(astmodulestate_global->%s_singleton);" % t .name , 3 )
1149
1147
self .emit ("return astmodulestate_global->%s_singleton;" % t .name , 3 )
1150
- self .emit ("default:" , 2 )
1151
- self .emit ('/* should never happen, but just in case ... */' , 3 )
1152
- code = "PyErr_Format(PyExc_SystemError, \" unknown %s found\" );" % name
1153
- self .emit (code , 3 , reflow = False )
1154
- self .emit ("return NULL;" , 3 )
1155
1148
self .emit ("}" , 1 )
1149
+ self .emit ("Py_UNREACHABLE();" , 1 );
1156
1150
self .emit ("}" , 0 )
1157
1151
1158
1152
def visitProduct (self , prod , name ):
0 commit comments