summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 1a46064dd4..b477513dc1 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -268,7 +268,6 @@ PyCode_New(int argcount, int nlocals, int stacksize, int flags,
{
PyCodeObject *co;
int i;
- PyBufferProcs *pb;
/* Check argument types */
if (argcount < 0 || nlocals < 0 ||
code == NULL ||
@@ -279,16 +278,8 @@ PyCode_New(int argcount, int nlocals, int stacksize, int flags,
cellvars == NULL || !PyTuple_Check(cellvars) ||
name == NULL || !PyString_Check(name) ||
filename == NULL || !PyString_Check(filename) ||
- lnotab == NULL || !PyString_Check(lnotab)) {
- PyErr_BadInternalCall();
- return NULL;
- }
- pb = code->ob_type->tp_as_buffer;
- if (pb == NULL ||
- pb->bf_getreadbuffer == NULL ||
- pb->bf_getsegcount == NULL ||
- (*pb->bf_getsegcount)(code, NULL) != 1)
- {
+ lnotab == NULL || !PyString_Check(lnotab) ||
+ !PyObject_CheckReadBuffer(code)) {
PyErr_BadInternalCall();
return NULL;
}