mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-31653: Remove deadcode in semlock_acquire() (#4091)
Fix the following Coverity warning:
>>> CID 1420038: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "res = sem_trywait(self->han...".
321 res = sem_trywait(self->handle);
The deadcode was introduced by the commit
c872d39d32
.
This commit is contained in:
parent
62adc55aff
commit
828ca59208
1 changed files with 4 additions and 4 deletions
|
@ -315,12 +315,12 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds)
|
|||
/* Couldn't acquire immediately, need to block */
|
||||
do {
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
if (blocking && timeout_obj == Py_None)
|
||||
if (timeout_obj == Py_None) {
|
||||
res = sem_wait(self->handle);
|
||||
else if (!blocking)
|
||||
res = sem_trywait(self->handle);
|
||||
else
|
||||
}
|
||||
else {
|
||||
res = sem_timedwait(self->handle, &deadline);
|
||||
}
|
||||
Py_END_ALLOW_THREADS
|
||||
err = errno;
|
||||
if (res == MP_EXCEPTION_HAS_BEEN_SET)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue