Skip to content

Commit 27ee0f8

Browse files
David Carliercsabella
authored andcommitted
Fix couple of dead code paths (pythonGH-7418)
1 parent e7b1136 commit 27ee0f8

4 files changed

Lines changed: 0 additions & 7 deletions

File tree

Objects/bytesobject.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,12 +1617,10 @@ bytes_richcompare(PyBytesObject *a, PyBytesObject *b, int op)
16171617
case Py_GE:
16181618
/* a string is equal to itself */
16191619
Py_RETURN_TRUE;
1620-
break;
16211620
case Py_NE:
16221621
case Py_LT:
16231622
case Py_GT:
16241623
Py_RETURN_FALSE;
1625-
break;
16261624
default:
16271625
PyErr_BadArgument();
16281626
return NULL;

Objects/stringlib/fastsearch.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
192192
}
193193
return count;
194194
}
195-
return -1;
196195
}
197196

198197
mlast = m - 1;

Python/ast.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,6 @@ ast_for_expr(struct compiling *c, const node *n)
29712971
return Compare(expression, ops, cmps, LINENO(n), n->n_col_offset,
29722972
n->n_end_lineno, n->n_end_col_offset, c->c_arena);
29732973
}
2974-
break;
29752974

29762975
case star_expr:
29772976
return ast_for_starred(c, n);
@@ -3618,7 +3617,6 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
36183617
return NULL;
36193618
return a;
36203619
}
3621-
break;
36223620
case dotted_name:
36233621
if (NCH(n) == 1) {
36243622
node *name_node = CHILD(n, 0);
@@ -3669,7 +3667,6 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
36693667
}
36703668
return alias(str, NULL, c->c_arena);
36713669
}
3672-
break;
36733670
case STAR:
36743671
str = PyUnicode_InternFromString("*");
36753672
if (!str)

Python/compile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4868,7 +4868,6 @@ compiler_visit_expr1(struct compiler *c, expr_ty e)
48684868
return compiler_error(c,
48694869
"can't use starred expression here");
48704870
}
4871-
break;
48724871
case Name_kind:
48734872
return compiler_nameop(c, e->v.Name.id, e->v.Name.ctx);
48744873
/* child nodes of List and Tuple will have expr_context set */

0 commit comments

Comments
 (0)