Commit 1da14a3c authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #1168 from kmod/reftests2

Fix the last two reffail tests
parents 183aa5f7 3beb6d11
......@@ -81,7 +81,7 @@ PyAPI_FUNC(PyObject *) PyMethod_Class(PyObject *) PYSTON_NOEXCEPT;
* can't fail, never sets an exception, and NULL is not an error (it just
* means "not found").
*/
PyAPI_FUNC(PyObject *) _PyInstance_Lookup(PyObject *pinst, PyObject *name) PYSTON_NOEXCEPT;
PyAPI_FUNC(BORROWED(PyObject *)) _PyInstance_Lookup(PyObject *pinst, PyObject *name) PYSTON_NOEXCEPT;
// Pyston change: no longer macros
#if 0
......
# expected: reffail
# expected: fail
# - takes too long
# Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
......
# expected: fail
import os
import unittest
import shelve
......
# expected: reffail
# - leaked refs, some test failures?
# Copyright (C) 2003 Python Software Foundation
import unittest
......
# expected: fail
import unittest
from test import test_support
......
......@@ -3069,8 +3069,10 @@ init_elementtree(void)
);
if (!PyRun_String(bootstrap, Py_file_input, g, NULL))
PyObject* bootstrap_ret;
if (!(bootstrap_ret = PyRun_String(bootstrap, Py_file_input, g, NULL)))
return;
Py_DECREF(bootstrap_ret);
elementpath_obj = PyDict_GetItemString(g, "ElementPath");
......@@ -3090,6 +3092,8 @@ init_elementtree(void)
elementtree_iter_obj = PyDict_GetItemString(g, "iter");
elementtree_itertext_obj = PyDict_GetItemString(g, "itertext");
Py_DECREF(g);
#if defined(USE_PYEXPAT_CAPI)
/* link against pyexpat, if possible */
expat_capi = PyCapsule_Import(PyExpat_CAPSULE_NAME, 0);
......
......@@ -77,7 +77,7 @@ static BORROWED(Box*) classLookup(BoxedClassobj* cls, BoxedString* attr) {
return classLookup<NOT_REWRITABLE>(cls, attr, NULL);
}
extern "C" PyObject* _PyInstance_Lookup(PyObject* pinst, PyObject* pname) noexcept {
extern "C" BORROWED(PyObject*) _PyInstance_Lookup(PyObject* pinst, PyObject* pname) noexcept {
RELEASE_ASSERT(PyInstance_Check(pinst), "");
BoxedInstance* inst = (BoxedInstance*)pinst;
......@@ -92,7 +92,7 @@ extern "C" PyObject* _PyInstance_Lookup(PyObject* pinst, PyObject* pname) noexce
Box* v = inst->getattr(name);
if (v == NULL)
v = classLookup(inst->inst_cls, name);
return xincref(v);
return v;
} catch (ExcInfo e) {
setCAPIException(e);
return NULL;
......
......@@ -4807,6 +4807,9 @@ extern "C" void Py_Finalize() noexcept {
call_sys_exitfunc();
// initialized = 0;
PyType_ClearCache();
PyGC_Collect();
PyImport_Cleanup();
#ifdef Py_REF_DEBUG
......
# expected: reffail
import os, sys
sys.path.append(os.path.dirname(__file__) + "/../lib")
......
# expected: reffail
import os
import sys
import subprocess
......
# expected: fail
# - __del__ not supported
# probably need to have some gc collections going on as well
# Classes should be freed right away
......
# expected: refstatfail
# skip-if: '-O' in EXTRA_JIT_ARGS
# expected: statfail
# statcheck: 4 <= noninit_count('num_deopt') < 50
# statcheck: 1 <= stats["num_osr_exits"] <= 2
......
# expected: refstatfail
# skip-if: '-O' in EXTRA_JIT_ARGS
# statcheck: 4 <= noninit_count('num_deopt') < 50
# statcheck: 1 <= stats["num_osr_exits"] <= 2
......
# expected: reffail
# test is based on the cpython ElementTree doc
def test(ET):
xml_str = """<?xml version="1.0"?>
......
......@@ -217,8 +217,6 @@ def get_test_options(fn, check_stats, run_memcheck):
if opts.expected == "reffail":
opts.expected = "fail"
if opts.expected == "refstatfail":
opts.expected = "statfail"
if not opts.skip:
# consider other reasons for skipping file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment