mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	gh-116664: Fix unused var warnings in _warnings.c in non-free-threaded builds (#117373)
The warnings were introduced by commit c1712ef06.
			
			
This commit is contained in:
		
							parent
							
								
									0fa571dbcd
								
							
						
					
					
						commit
						ddf95b5f16
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -994,8 +994,10 @@ do_warn(PyObject *message, PyObject *category, Py_ssize_t stack_level,
 | 
				
			||||||
                       &filename, &lineno, &module, ®istry))
 | 
					                       &filename, &lineno, &module, ®istry))
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef Py_GIL_DISABLED
 | 
				
			||||||
    WarningsState *st = warnings_get_state(tstate->interp);
 | 
					    WarningsState *st = warnings_get_state(tstate->interp);
 | 
				
			||||||
    assert(st != NULL);
 | 
					    assert(st != NULL);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
					    Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
				
			||||||
    res = warn_explicit(tstate, category, message, filename, lineno, module, registry,
 | 
					    res = warn_explicit(tstate, category, message, filename, lineno, module, registry,
 | 
				
			||||||
| 
						 | 
					@ -1149,8 +1151,10 @@ warnings_warn_explicit_impl(PyObject *module, PyObject *message,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef Py_GIL_DISABLED
 | 
				
			||||||
    WarningsState *st = warnings_get_state(tstate->interp);
 | 
					    WarningsState *st = warnings_get_state(tstate->interp);
 | 
				
			||||||
    assert(st != NULL);
 | 
					    assert(st != NULL);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
					    Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
				
			||||||
    returned = warn_explicit(tstate, category, message, filename, lineno,
 | 
					    returned = warn_explicit(tstate, category, message, filename, lineno,
 | 
				
			||||||
| 
						 | 
					@ -1296,8 +1300,10 @@ PyErr_WarnExplicitObject(PyObject *category, PyObject *message,
 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef Py_GIL_DISABLED
 | 
				
			||||||
    WarningsState *st = warnings_get_state(tstate->interp);
 | 
					    WarningsState *st = warnings_get_state(tstate->interp);
 | 
				
			||||||
    assert(st != NULL);
 | 
					    assert(st != NULL);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
					    Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
				
			||||||
    res = warn_explicit(tstate, category, message, filename, lineno,
 | 
					    res = warn_explicit(tstate, category, message, filename, lineno,
 | 
				
			||||||
| 
						 | 
					@ -1367,8 +1373,10 @@ PyErr_WarnExplicitFormat(PyObject *category,
 | 
				
			||||||
        PyObject *res;
 | 
					        PyObject *res;
 | 
				
			||||||
        PyThreadState *tstate = get_current_tstate();
 | 
					        PyThreadState *tstate = get_current_tstate();
 | 
				
			||||||
        if (tstate != NULL) {
 | 
					        if (tstate != NULL) {
 | 
				
			||||||
 | 
					#ifdef Py_GIL_DISABLED
 | 
				
			||||||
            WarningsState *st = warnings_get_state(tstate->interp);
 | 
					            WarningsState *st = warnings_get_state(tstate->interp);
 | 
				
			||||||
            assert(st != NULL);
 | 
					            assert(st != NULL);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
					            Py_BEGIN_CRITICAL_SECTION_MUT(&st->mutex);
 | 
				
			||||||
            res = warn_explicit(tstate, category, message, filename, lineno,
 | 
					            res = warn_explicit(tstate, category, message, filename, lineno,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue