@@ -519,8 +519,8 @@ pysqlite_connection_iterdump(pysqlite_Connection *self, PyObject *Py_UNUSED(igno
519
519
}
520
520
521
521
PyDoc_STRVAR (pysqlite_connection_backup__doc__ ,
522
- "backup($self, /, target=<unrepresentable> , *, pages=-1, progress=None,\n"
523
- " name=\'main\', sleep=0.25)\n"
522
+ "backup($self, /, target, *, pages=-1, progress=None, name=\'main\' ,\n"
523
+ " sleep=0.25)\n"
524
524
"--\n"
525
525
"\n"
526
526
"Makes a backup of the database. Non-standard." );
@@ -541,31 +541,22 @@ pysqlite_connection_backup(pysqlite_Connection *self, PyObject *const *args, Py_
541
541
static const char * const _keywords [] = {"target" , "pages" , "progress" , "name" , "sleep" , NULL };
542
542
static _PyArg_Parser _parser = {NULL , _keywords , "backup" , 0 };
543
543
PyObject * argsbuf [5 ];
544
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE (kwnames ) : 0 ) - 0 ;
545
- pysqlite_Connection * target = NULL ;
544
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE (kwnames ) : 0 ) - 1 ;
545
+ pysqlite_Connection * target ;
546
546
int pages = -1 ;
547
547
PyObject * progress = Py_None ;
548
548
const char * name = "main" ;
549
549
double sleep = 0.25 ;
550
550
551
- args = _PyArg_UnpackKeywords (args , nargs , NULL , kwnames , & _parser , 0 , 1 , 0 , argsbuf );
551
+ args = _PyArg_UnpackKeywords (args , nargs , NULL , kwnames , & _parser , 1 , 1 , 0 , argsbuf );
552
552
if (!args ) {
553
553
goto exit ;
554
554
}
555
- if (!noptargs ) {
556
- goto skip_optional_pos ;
557
- }
558
- if (args [0 ]) {
559
- if (!PyObject_TypeCheck (args [0 ], pysqlite_ConnectionType )) {
560
- _PyArg_BadArgument ("backup" , "argument 'target'" , (pysqlite_ConnectionType )-> tp_name , args [0 ]);
561
- goto exit ;
562
- }
563
- target = (pysqlite_Connection * )args [0 ];
564
- if (!-- noptargs ) {
565
- goto skip_optional_pos ;
566
- }
555
+ if (!PyObject_TypeCheck (args [0 ], pysqlite_ConnectionType )) {
556
+ _PyArg_BadArgument ("backup" , "argument 'target'" , (pysqlite_ConnectionType )-> tp_name , args [0 ]);
557
+ goto exit ;
567
558
}
568
- skip_optional_pos :
559
+ target = ( pysqlite_Connection * ) args [ 0 ];
569
560
if (!noptargs ) {
570
561
goto skip_optional_kwonly ;
571
562
}
@@ -719,4 +710,4 @@ pysqlite_connection_exit(pysqlite_Connection *self, PyObject *const *args, Py_ss
719
710
#ifndef PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
720
711
#define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
721
712
#endif /* !defined(PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF) */
722
- /*[clinic end generated code: output=7cb13d491a5970aa input=a9049054013a1b77]*/
713
+ /*[clinic end generated code: output=c1bf09db3bcd0105 input=a9049054013a1b77]*/
0 commit comments