@@ -514,7 +514,6 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
514
514
if (!v )
515
515
goto finally ;
516
516
if (v == Py_None ) {
517
- Py_DECREF (v );
518
517
_Py_DECLARE_STR (anon_string , "<string>" );
519
518
* filename = & _Py_STR (anon_string );
520
519
Py_INCREF (* filename );
@@ -537,7 +536,6 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
537
536
goto finally ;
538
537
if (v == Py_None ) {
539
538
* offset = -1 ;
540
- Py_DECREF (v );
541
539
} else {
542
540
hold = PyLong_AsSsize_t (v );
543
541
Py_DECREF (v );
@@ -554,7 +552,6 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
554
552
}
555
553
else if (v == Py_None ) {
556
554
* end_lineno = * lineno ;
557
- Py_DECREF (v );
558
555
} else {
559
556
hold = PyLong_AsSsize_t (v );
560
557
Py_DECREF (v );
@@ -570,7 +567,6 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
570
567
}
571
568
else if (v == Py_None ) {
572
569
* end_offset = -1 ;
573
- Py_DECREF (v );
574
570
} else {
575
571
hold = PyLong_AsSsize_t (v );
576
572
Py_DECREF (v );
@@ -588,7 +584,6 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
588
584
if (!v )
589
585
goto finally ;
590
586
if (v == Py_None ) {
591
- Py_DECREF (v );
592
587
* text = NULL ;
593
588
}
594
589
else {
@@ -788,7 +783,6 @@ _PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars)
788
783
_PyErr_NormalizeException (tstate , & exception , & v , & tb );
789
784
if (tb == NULL ) {
790
785
tb = Py_None ;
791
- Py_INCREF (tb );
792
786
}
793
787
PyException_SetTraceback (v , tb );
794
788
if (exception == NULL ) {
@@ -835,11 +829,9 @@ _PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars)
835
829
tolerate NULLs, so just be safe. */
836
830
if (exception2 == NULL ) {
837
831
exception2 = Py_None ;
838
- Py_INCREF (exception2 );
839
832
}
840
833
if (v2 == NULL ) {
841
834
v2 = Py_None ;
842
- Py_INCREF (v2 );
843
835
}
844
836
fflush (stdout );
845
837
PySys_WriteStderr ("Error in sys.excepthook:\n" );
0 commit comments