Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06cc973

Browse files
committed
Replaced a test with an assertion.
(Suggested by Michael Hudson.)
1 parent 01ba799 commit 06cc973

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Python/compile.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,8 @@ optimize_code(PyObject *code, PyObject* consts, PyObject *names, PyObject *linen
509509
if (memchr(lineno, 255, tabsiz) != NULL)
510510
goto exitUnchanged;
511511

512-
if (!PyString_Check(code))
513-
goto exitUnchanged;
514-
515512
/* Avoid situations where jump retargeting could overflow */
513+
assert(PyString_Check(code));
516514
codelen = PyString_Size(code);
517515
if (codelen > 32700)
518516
goto exitUnchanged;

0 commit comments

Comments
 (0)