@@ -364,26 +364,24 @@ typevar_new_impl(PyTypeObject *type, PyObject *name, PyObject *constraints,
364
364
}
365
365
}
366
366
367
- if (constraints != NULL ) {
368
- if (!PyTuple_CheckExact (constraints )) {
369
- PyErr_SetString (PyExc_TypeError ,
370
- "constraints must be a tuple" );
371
- return NULL ;
372
- }
373
- Py_ssize_t n_constraints = PyTuple_GET_SIZE (constraints );
374
- if (n_constraints == 1 ) {
375
- PyErr_SetString (PyExc_TypeError ,
376
- "A single constraint is not allowed" );
377
- Py_XDECREF (bound );
378
- return NULL ;
379
- } else if (n_constraints == 0 ) {
380
- constraints = NULL ;
381
- } else if (bound != NULL ) {
382
- PyErr_SetString (PyExc_TypeError ,
383
- "Constraints cannot be combined with bound=..." );
384
- Py_XDECREF (bound );
385
- return NULL ;
386
- }
367
+ if (!PyTuple_CheckExact (constraints )) {
368
+ PyErr_SetString (PyExc_TypeError ,
369
+ "Constraints must be a tuple" );
370
+ return NULL ;
371
+ }
372
+ Py_ssize_t n_constraints = PyTuple_GET_SIZE (constraints );
373
+ if (n_constraints == 1 ) {
374
+ PyErr_SetString (PyExc_TypeError ,
375
+ "A single constraint is not allowed" );
376
+ Py_XDECREF (bound );
377
+ return NULL ;
378
+ } else if (n_constraints == 0 ) {
379
+ constraints = NULL ;
380
+ } else if (bound != NULL ) {
381
+ PyErr_SetString (PyExc_TypeError ,
382
+ "Constraints cannot be combined with bound=..." );
383
+ Py_XDECREF (bound );
384
+ return NULL ;
387
385
}
388
386
PyObject * module = caller ();
389
387
if (module == NULL ) {
0 commit comments