Merged revisions 60350-60363 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r60355 | neal.norwitz | 2008-01-27 18:10:14 +0100 (Sun, 27 Jan 2008) | 1 line

  Whitespace cleanup
........
  r60356 | neal.norwitz | 2008-01-27 18:10:29 +0100 (Sun, 27 Jan 2008) | 1 line

  Add assertion that we do not blow out newl
........
  r60357 | neal.norwitz | 2008-01-27 18:10:35 +0100 (Sun, 27 Jan 2008) | 1 line

  Initialize variable to prevent warning on some platform/config.
........
  r60358 | neal.norwitz | 2008-01-27 18:10:43 +0100 (Sun, 27 Jan 2008) | 1 line

  Update to newer version of ffi.  Fixes crashes and test failures of longdouble
........
  r60359 | neal.norwitz | 2008-01-27 18:10:50 +0100 (Sun, 27 Jan 2008) | 1 line

  Add a tiny sleep and additional flush to force the file to really be synced.
........
  r60360 | neal.norwitz | 2008-01-27 18:10:58 +0100 (Sun, 27 Jan 2008) | 1 line

  Retry connection in case it fails to reduce flakiness
........
  r60361 | neal.norwitz | 2008-01-27 18:11:11 +0100 (Sun, 27 Jan 2008) | 4 lines

  Catch socket errors that are often the cause of transient failures.
  Many of these exceptions are due to resource unavailable, so the
  existing code should be able to handle many more spurious errors.
........
  r60362 | neal.norwitz | 2008-01-27 18:12:15 +0100 (Sun, 27 Jan 2008) | 1 line

  Reduce buffer size since we do not need 1k
........
  r60363 | neal.norwitz | 2008-01-27 18:13:07 +0100 (Sun, 27 Jan 2008) | 1 line

  Print periodic "still working" messages since this suite is slow.
........
This commit is contained in:
Christian Heimes 2008-01-27 18:55:54 +00:00
parent 661b0a15d7
commit 412dc9c88f
9 changed files with 133 additions and 54 deletions

View file

@ -3,6 +3,7 @@
Run all test cases. Run all test cases.
""" """
import sys import sys
import time
import unittest import unittest
import test.test_support import test.test_support
from test.test_support import requires, run_unittest, unlink from test.test_support import requires, run_unittest, unlink
@ -22,6 +23,30 @@ if 'silent' in sys.argv: # take care of old flag, just in case
sys.argv.remove('silent') sys.argv.remove('silent')
class TimingCheck(unittest.TestCase):
"""This class is not a real test. Its purpose is to print a message
periodically when the test runs slowly. This will prevent the buildbots
from timing out on slow machines."""
# How much time in seconds before printing a 'Still working' message.
# Since this is run at most once between each test module, use a smaller
# interval than other tests.
_PRINT_WORKING_MSG_INTERVAL = 4 * 60
# next_time is used as a global variable that survives each instance.
# This is necessary since a new instance will be created for each test.
next_time = time.time() + _PRINT_WORKING_MSG_INTERVAL
def testCheckElapsedTime(self):
# Print still working message since these tests can be really slow.
now = time.time()
if self.next_time <= now:
TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
sys.__stdout__.write(' test_bsddb3 still working, be patient...\n')
sys.__stdout__.flush()
def suite(): def suite():
try: try:
# this is special, it used to segfault the interpreter # this is special, it used to segfault the interpreter
@ -56,6 +81,7 @@ def suite():
module = __import__("bsddb.test."+name, globals(), locals(), name) module = __import__("bsddb.test."+name, globals(), locals(), name)
#print module,name #print module,name
alltests.addTest(module.test_suite()) alltests.addTest(module.test_suite())
alltests.addTest(unittest.makeSuite(TimingCheck))
return alltests return alltests

View file

@ -1,8 +1,9 @@
import unittest import unittest
from test import test_support from test import test_support
import os
import os, resource import resource
import time
# This test is checking a few specific problem spots with the resource module. # This test is checking a few specific problem spots with the resource module.
@ -59,6 +60,8 @@ class ResourceTest(unittest.TestCase):
# an attempt to ensure the file is really synced and # an attempt to ensure the file is really synced and
# the exception raised. # the exception raised.
for i in range(5): for i in range(5):
time.sleep(.1)
f.flush()
f.close() f.close()
except IOError: except IOError:
if not limit_set: if not limit_set:

View file

@ -345,9 +345,11 @@ class SimpleServerTestCase(unittest.TestCase):
try: try:
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
self.assertEqual(p.pow(6,8), 6**8) self.assertEqual(p.pow(6,8), 6**8)
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# protocol error; provide additional information in test output # ignore failures due to non-blocking socket 'unavailable' errors
self.fail("%s\n%s" % (e, e.headers)) if not is_unavailable_exception(e):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, e.headers))
# [ch] The test 404 is causing lots of false alarms. # [ch] The test 404 is causing lots of false alarms.
def XXXtest_404(self): def XXXtest_404(self):
@ -369,9 +371,12 @@ class SimpleServerTestCase(unittest.TestCase):
'system.listMethods', 'system.methodHelp', 'system.listMethods', 'system.methodHelp',
'system.methodSignature', 'system.multicall']) 'system.methodSignature', 'system.multicall'])
self.assertEqual(set(meth), expected_methods) self.assertEqual(set(meth), expected_methods)
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# protocol error; provide additional information in test output # ignore failures due to non-blocking socket 'unavailable' errors
self.fail("%s\n%s" % (e, e.headers)) if not is_unavailable_exception(e):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, e.headers))
def test_introspection2(self): def test_introspection2(self):
try: try:
@ -379,9 +384,11 @@ class SimpleServerTestCase(unittest.TestCase):
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
divhelp = p.system.methodHelp('div') divhelp = p.system.methodHelp('div')
self.assertEqual(divhelp, 'This is the div function') self.assertEqual(divhelp, 'This is the div function')
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# protocol error; provide additional information in test output # ignore failures due to non-blocking socket 'unavailable' errors
self.fail("%s\n%s" % (e, e.headers)) if not is_unavailable_exception(e):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, e.headers))
def test_introspection3(self): def test_introspection3(self):
try: try:
@ -389,7 +396,7 @@ class SimpleServerTestCase(unittest.TestCase):
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
myfunction = p.system.methodHelp('my_function') myfunction = p.system.methodHelp('my_function')
self.assertEqual(myfunction, 'This is my function') self.assertEqual(myfunction, 'This is my function')
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# ignore failures due to non-blocking socket 'unavailable' errors # ignore failures due to non-blocking socket 'unavailable' errors
if not is_unavailable_exception(e): if not is_unavailable_exception(e):
# protocol error; provide additional information in test output # protocol error; provide additional information in test output
@ -402,9 +409,11 @@ class SimpleServerTestCase(unittest.TestCase):
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
divsig = p.system.methodSignature('div') divsig = p.system.methodSignature('div')
self.assertEqual(divsig, 'signatures not supported') self.assertEqual(divsig, 'signatures not supported')
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# protocol error; provide additional information in test output # ignore failures due to non-blocking socket 'unavailable' errors
self.fail("%s\n%s" % (e, e.headers)) if not is_unavailable_exception(e):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, e.headers))
def test_multicall(self): def test_multicall(self):
try: try:
@ -417,9 +426,11 @@ class SimpleServerTestCase(unittest.TestCase):
self.assertEqual(add_result, 2+3) self.assertEqual(add_result, 2+3)
self.assertEqual(pow_result, 6**8) self.assertEqual(pow_result, 6**8)
self.assertEqual(div_result, 127//42) self.assertEqual(div_result, 127//42)
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# protocol error; provide additional information in test output # ignore failures due to non-blocking socket 'unavailable' errors
self.fail("%s\n%s" % (e, e.headers)) if not is_unavailable_exception(e):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, e.headers))
def test_non_existing_multicall(self): def test_non_existing_multicall(self):
try: try:
@ -436,7 +447,7 @@ class SimpleServerTestCase(unittest.TestCase):
self.assertEqual(result.results[0]['faultString'], self.assertEqual(result.results[0]['faultString'],
'<type \'Exception\'>:method "this_is_not_exists" ' '<type \'Exception\'>:method "this_is_not_exists" '
'is not supported') 'is not supported')
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# ignore failures due to non-blocking socket 'unavailable' errors # ignore failures due to non-blocking socket 'unavailable' errors
if not is_unavailable_exception(e): if not is_unavailable_exception(e):
# protocol error; provide additional information in test output # protocol error; provide additional information in test output
@ -483,9 +494,11 @@ class FailingServerTestCase(unittest.TestCase):
try: try:
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
self.assertEqual(p.pow(6,8), 6**8) self.assertEqual(p.pow(6,8), 6**8)
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# protocol error; provide additional information in test output # ignore failures due to non-blocking socket 'unavailable' errors
self.fail("%s\n%s" % (e, e.headers)) if not is_unavailable_exception(e):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, e.headers))
def test_fail_no_info(self): def test_fail_no_info(self):
# use the broken message class # use the broken message class
@ -494,10 +507,12 @@ class FailingServerTestCase(unittest.TestCase):
try: try:
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
p.pow(6,8) p.pow(6,8)
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# The two server-side error headers shouldn't be sent back in this case # ignore failures due to non-blocking socket 'unavailable' errors
self.assertTrue(e.headers.get("X-exception") is None) if not is_unavailable_exception(e):
self.assertTrue(e.headers.get("X-traceback") is None) # The two server-side error headers shouldn't be sent back in this case
self.assertTrue(e.headers.get("X-exception") is None)
self.assertTrue(e.headers.get("X-traceback") is None)
else: else:
self.fail('ProtocolError not raised') self.fail('ProtocolError not raised')
@ -512,11 +527,13 @@ class FailingServerTestCase(unittest.TestCase):
try: try:
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
p.pow(6,8) p.pow(6,8)
except xmlrpclib.ProtocolError as e: except (xmlrpclib.ProtocolError, socket.error) as e:
# We should get error info in the response # ignore failures due to non-blocking socket 'unavailable' errors
expected_err = "invalid literal for int() with base 10: 'I am broken'" if not is_unavailable_exception(e):
self.assertEqual(e.headers.get("x-exception"), expected_err) # We should get error info in the response
self.assertTrue(e.headers.get("x-traceback") is not None) expected_err = "invalid literal for int() with base 10: 'I am broken'"
self.assertEqual(e.headers.get("x-exception"), expected_err)
self.assertTrue(e.headers.get("x-traceback") is not None)
else: else:
self.fail('ProtocolError not raised') self.fail('ProtocolError not raised')

View file

@ -25,11 +25,22 @@
#include <ffi.h> #include <ffi.h>
#include <ffi_common.h> #include <ffi_common.h>
#include <stdlib.h> #include <stdlib.h>
extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)(void)); /* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
extern void ffi_closure_osf(void); all further uses in this file will refer to the 128-bit type. */
#if defined(__LONG_DOUBLE_128__)
# if FFI_TYPE_LONGDOUBLE != 4
# error FFI_TYPE_LONGDOUBLE out of date
# endif
#else
# undef FFI_TYPE_LONGDOUBLE
# define FFI_TYPE_LONGDOUBLE 4
#endif
extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)(void))
FFI_HIDDEN;
extern void ffi_closure_osf(void) FFI_HIDDEN;
ffi_status ffi_status
@ -49,6 +60,11 @@ ffi_prep_cif_machdep(ffi_cif *cif)
cif->flags = cif->rtype->type; cif->flags = cif->rtype->type;
break; break;
case FFI_TYPE_LONGDOUBLE:
/* 128-bit long double is returned in memory, like a struct. */
cif->flags = FFI_TYPE_STRUCT;
break;
default: default:
cif->flags = FFI_TYPE_INT; cif->flags = FFI_TYPE_INT;
break; break;
@ -57,6 +73,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
return FFI_OK; return FFI_OK;
} }
void void
ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{ {
@ -64,8 +81,6 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
long i, avn; long i, avn;
ffi_type **arg_types; ffi_type **arg_types;
FFI_ASSERT (cif->abi == FFI_OSF);
/* If the return value is a struct and we don't have a return /* If the return value is a struct and we don't have a return
value address then we need to make one. */ value address then we need to make one. */
if (rvalue == NULL && cif->flags == FFI_TYPE_STRUCT) if (rvalue == NULL && cif->flags == FFI_TYPE_STRUCT)
@ -84,6 +99,8 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
while (i < avn) while (i < avn)
{ {
size_t size = (*arg_types)->size;
switch ((*arg_types)->type) switch ((*arg_types)->type)
{ {
case FFI_TYPE_SINT8: case FFI_TYPE_SINT8:
@ -129,6 +146,12 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
*(double *) argp = *(double *)(* avalue); *(double *) argp = *(double *)(* avalue);
break; break;
case FFI_TYPE_LONGDOUBLE:
/* 128-bit long double is passed by reference. */
*(long double **) argp = (long double *)(* avalue);
size = sizeof (long double *);
break;
case FFI_TYPE_STRUCT: case FFI_TYPE_STRUCT:
memcpy(argp, *avalue, (*arg_types)->size); memcpy(argp, *avalue, (*arg_types)->size);
break; break;
@ -137,7 +160,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
FFI_ASSERT(0); FFI_ASSERT(0);
} }
argp += ALIGN((*arg_types)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; argp += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
i++, arg_types++, avalue++; i++, arg_types++, avalue++;
} }
@ -153,8 +176,6 @@ ffi_prep_closure (ffi_closure* closure,
{ {
unsigned int *tramp; unsigned int *tramp;
FFI_ASSERT (cif->abi == FFI_OSF);
tramp = (unsigned int *) &closure->tramp[0]; tramp = (unsigned int *) &closure->tramp[0];
tramp[0] = 0x47fb0401; /* mov $27,$1 */ tramp[0] = 0x47fb0401; /* mov $27,$1 */
tramp[1] = 0xa77b0010; /* ldq $27,16($27) */ tramp[1] = 0xa77b0010; /* ldq $27,16($27) */
@ -177,7 +198,8 @@ ffi_prep_closure (ffi_closure* closure,
return FFI_OK; return FFI_OK;
} }
int
long FFI_HIDDEN
ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp) ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
{ {
ffi_cif *cif; ffi_cif *cif;
@ -205,6 +227,8 @@ ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
/* Grab the addresses of the arguments from the stack frame. */ /* Grab the addresses of the arguments from the stack frame. */
while (i < avn) while (i < avn)
{ {
size_t size = arg_types[i]->size;
switch (arg_types[i]->type) switch (arg_types[i]->type)
{ {
case FFI_TYPE_SINT8: case FFI_TYPE_SINT8:
@ -236,16 +260,22 @@ ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
avalue[i] = &argp[argn - (argn < 6 ? 6 : 0)]; avalue[i] = &argp[argn - (argn < 6 ? 6 : 0)];
break; break;
case FFI_TYPE_LONGDOUBLE:
/* 128-bit long double is passed by reference. */
avalue[i] = (long double *) argp[argn];
size = sizeof (long double *);
break;
default: default:
FFI_ASSERT(0); abort ();
} }
argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; argn += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
i++; i++;
} }
/* Invoke the closure. */ /* Invoke the closure. */
(closure->fun) (cif, rvalue, avalue, closure->user_data); closure->fun (cif, rvalue, avalue, closure->user_data);
/* Tell ffi_closure_osf how to perform return type promotions. */ /* Tell ffi_closure_osf how to perform return type promotions. */
return cif->rtype->type; return cif->rtype->type;

View file

@ -1,10 +1,8 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
osf.S - Copyright (c) 1998, 2001 Red Hat osf.S - Copyright (c) 1998, 2001, 2007 Red Hat
Alpha/OSF Foreign Function Interface Alpha/OSF Foreign Function Interface
$Id: osf.S,v 1.2 2006/03/03 20:24:26 theller Exp $
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
``Software''), to deal in the Software without restriction, including ``Software''), to deal in the Software without restriction, including
@ -42,6 +40,8 @@
.align 3 .align 3
.globl ffi_call_osf .globl ffi_call_osf
.ent ffi_call_osf .ent ffi_call_osf
FFI_HIDDEN(ffi_call_osf)
ffi_call_osf: ffi_call_osf:
.frame $15, 32, $26, 0 .frame $15, 32, $26, 0
.mask 0x4008000, -32 .mask 0x4008000, -32
@ -129,6 +129,8 @@ $LFE1:
.align 3 .align 3
.globl ffi_closure_osf .globl ffi_closure_osf
.ent ffi_closure_osf .ent ffi_closure_osf
FFI_HIDDEN(ffi_closure_osf)
ffi_closure_osf: ffi_closure_osf:
.frame $30, 16*8, $26, 0 .frame $30, 16*8, $26, 0
.mask 0x4000000, -16*8 .mask 0x4000000, -16*8
@ -265,7 +267,7 @@ $load_table:
.gprel32 $load_32 # FFI_TYPE_INT .gprel32 $load_32 # FFI_TYPE_INT
.gprel32 $load_float # FFI_TYPE_FLOAT .gprel32 $load_float # FFI_TYPE_FLOAT
.gprel32 $load_double # FFI_TYPE_DOUBLE .gprel32 $load_double # FFI_TYPE_DOUBLE
.gprel32 $load_double # FFI_TYPE_LONGDOUBLE .gprel32 $load_none # FFI_TYPE_LONGDOUBLE
.gprel32 $load_u8 # FFI_TYPE_UINT8 .gprel32 $load_u8 # FFI_TYPE_UINT8
.gprel32 $load_s8 # FFI_TYPE_SINT8 .gprel32 $load_s8 # FFI_TYPE_SINT8
.gprel32 $load_u16 # FFI_TYPE_UINT16 .gprel32 $load_u16 # FFI_TYPE_UINT16

View file

@ -684,7 +684,7 @@ _get_peer_alt_names (X509 *certificate) {
} }
p = ext->value->data; p = ext->value->data;
if(method->it) if (method->it)
names = (GENERAL_NAMES*) names = (GENERAL_NAMES*)
(ASN1_item_d2i(NULL, (ASN1_item_d2i(NULL,
&p, &p,

View file

@ -59,7 +59,7 @@ type_modified(PyTypeObject *type)
PyObject *raw, *ref; PyObject *raw, *ref;
Py_ssize_t i, n; Py_ssize_t i, n;
if(!PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) if (!PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG))
return; return;
raw = type->tp_subclasses; raw = type->tp_subclasses;
@ -95,7 +95,7 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) {
Py_ssize_t i, n; Py_ssize_t i, n;
int clear = 0; int clear = 0;
if(!PyType_HasFeature(type, Py_TPFLAGS_HAVE_VERSION_TAG)) if (!PyType_HasFeature(type, Py_TPFLAGS_HAVE_VERSION_TAG))
return; return;
n = PyTuple_GET_SIZE(bases); n = PyTuple_GET_SIZE(bases);
@ -1342,8 +1342,8 @@ mro_implementation(PyTypeObject *type)
PyObject *bases, *result; PyObject *bases, *result;
PyObject *to_merge, *bases_aslist; PyObject *to_merge, *bases_aslist;
if(type->tp_dict == NULL) { if (type->tp_dict == NULL) {
if(PyType_Ready(type) < 0) if (PyType_Ready(type) < 0)
return NULL; return NULL;
} }
@ -2204,7 +2204,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
unsigned int h; unsigned int h;
if (MCACHE_CACHEABLE_NAME(name) && if (MCACHE_CACHEABLE_NAME(name) &&
PyType_HasFeature(type,Py_TPFLAGS_VALID_VERSION_TAG)) { PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) {
/* fast path */ /* fast path */
h = MCACHE_HASH_METHOD(type, name); h = MCACHE_HASH_METHOD(type, name);
if (method_cache[h].version == type->tp_version_tag && if (method_cache[h].version == type->tp_version_tag &&

View file

@ -657,6 +657,7 @@ decode_str(const char *str, struct tok_state *tok)
for (s = str;; s++) { for (s = str;; s++) {
if (*s == '\0') break; if (*s == '\0') break;
else if (*s == '\n') { else if (*s == '\n') {
assert(lineno < 2);
newl[lineno] = s; newl[lineno] = s;
lineno++; lineno++;
if (lineno == 2) break; if (lineno == 2) break;

View file

@ -2288,7 +2288,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
else { else {
/* This check is expensive! */ /* This check is expensive! */
if (PyErr_Occurred()) { if (PyErr_Occurred()) {
char buf[1024]; char buf[128];
sprintf(buf, "Stack unwind with exception " sprintf(buf, "Stack unwind with exception "
"set and why=%d", why); "set and why=%d", why);
Py_FatalError(buf); Py_FatalError(buf);