mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 18:00:28 +00:00
Removed BadInternalCall following pyston
Three tests need to be enabled in MODE=dbg.
This commit is contained in:
parent
712ead6ee8
commit
c626c914be
4 changed files with 13 additions and 2 deletions
4
third_party/python/Include/pyerrors.h
vendored
4
third_party/python/Include/pyerrors.h
vendored
|
@ -318,7 +318,11 @@ void PyErr_BadInternalCall(void);
|
||||||
void _PyErr_BadInternalCall(const char *filename, int lineno);
|
void _PyErr_BadInternalCall(const char *filename, int lineno);
|
||||||
/* Mask the old API with a call to the new API for code compiled under
|
/* Mask the old API with a call to the new API for code compiled under
|
||||||
Python 2.0: */
|
Python 2.0: */
|
||||||
|
#ifdef USE_BADINTERNALCALL
|
||||||
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
|
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
|
||||||
|
#else
|
||||||
|
#define PyErr_BadInternalCall()
|
||||||
|
#endif
|
||||||
/* Function to create a new exception */
|
/* Function to create a new exception */
|
||||||
PyObject * PyErr_NewException(
|
PyObject * PyErr_NewException(
|
||||||
const char *name, PyObject *base, PyObject *dict);
|
const char *name, PyObject *base, PyObject *dict);
|
||||||
|
|
4
third_party/python/Lib/test/test_code.py
vendored
4
third_party/python/Lib/test/test_code.py
vendored
|
@ -299,6 +299,8 @@ if check_impl_detail(cpython=True) and ctypes is not None:
|
||||||
return eval('lambda:42')
|
return eval('lambda:42')
|
||||||
|
|
||||||
def test_get_non_code(self):
|
def test_get_non_code(self):
|
||||||
|
return
|
||||||
|
# TODO: <ahgamut> have a sysconfig check to run this test in dbg #
|
||||||
f = self.get_func()
|
f = self.get_func()
|
||||||
|
|
||||||
self.assertRaises(SystemError, SetExtra, 42, FREE_INDEX,
|
self.assertRaises(SystemError, SetExtra, 42, FREE_INDEX,
|
||||||
|
@ -307,6 +309,8 @@ if check_impl_detail(cpython=True) and ctypes is not None:
|
||||||
ctypes.c_voidp(100))
|
ctypes.c_voidp(100))
|
||||||
|
|
||||||
def test_bad_index(self):
|
def test_bad_index(self):
|
||||||
|
return
|
||||||
|
# TODO: <ahgamut> have a sysconfig check to run this test in dbg #
|
||||||
f = self.get_func()
|
f = self.get_func()
|
||||||
self.assertRaises(SystemError, SetExtra, f.__code__,
|
self.assertRaises(SystemError, SetExtra, f.__code__,
|
||||||
FREE_INDEX+100, ctypes.c_voidp(100))
|
FREE_INDEX+100, ctypes.c_voidp(100))
|
||||||
|
|
2
third_party/python/Lib/test/test_dict.py
vendored
2
third_party/python/Lib/test/test_dict.py
vendored
|
@ -1221,6 +1221,8 @@ class CAPITest(unittest.TestCase):
|
||||||
self.assertEqual(dict_getitem_knownhash(d, 'z', hash('z')), 3)
|
self.assertEqual(dict_getitem_knownhash(d, 'z', hash('z')), 3)
|
||||||
|
|
||||||
# not a dict
|
# not a dict
|
||||||
|
# TODO: <ahgamut> have a sysconfig check to run this test in dbg #
|
||||||
|
if False:
|
||||||
self.assertRaises(SystemError, dict_getitem_knownhash, [], 1, hash(1))
|
self.assertRaises(SystemError, dict_getitem_knownhash, [], 1, hash(1))
|
||||||
# key does not exist
|
# key does not exist
|
||||||
self.assertRaises(KeyError, dict_getitem_knownhash, {}, 1, hash(1))
|
self.assertRaises(KeyError, dict_getitem_knownhash, {}, 1, hash(1))
|
||||||
|
|
3
third_party/python/python.mk
vendored
3
third_party/python/python.mk
vendored
|
@ -2166,7 +2166,8 @@ THIRD_PARTY_PYTHON_STDLIB_PYS = \
|
||||||
|
|
||||||
ifeq ($(MODE), dbg)
|
ifeq ($(MODE), dbg)
|
||||||
THIRD_PARTY_PYTHON_FLAGS += \
|
THIRD_PARTY_PYTHON_FLAGS += \
|
||||||
-DUSE_TRACEMALLOC
|
-DUSE_TRACEMALLOC \
|
||||||
|
-DUSE_BADINTERNALCALL
|
||||||
THIRD_PARTY_PYTHON_STAGE1_A_SRCS += \
|
THIRD_PARTY_PYTHON_STAGE1_A_SRCS += \
|
||||||
third_party/python/Modules/_tracemalloc.c
|
third_party/python/Modules/_tracemalloc.c
|
||||||
THIRD_PARTY_PYTHON_STAGE2_A_SRCS += \
|
THIRD_PARTY_PYTHON_STAGE2_A_SRCS += \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue