Commit 05b35703 authored by Kevin Modzelewski's avatar Kevin Modzelewski

More small fixes

parent 05edd7f6
......@@ -23,7 +23,9 @@ __all__ = ["Hashable", "Iterable", "Iterator",
def _hasattr(C, attr):
try:
return any(attr in B.__dict__ for B in C.__mro__)
# Pyston temporary workaround: make this a list comprehension instead of generator comprehension,
# since any() can exit without exhausting the iterable.
return any([attr in B.__dict__ for B in C.__mro__])
except AttributeError:
# Old-style class
return hasattr(C, attr)
......
......@@ -2590,6 +2590,7 @@ extern "C" void PyString_Concat(register PyObject** pv, register PyObject* w) no
extern "C" void PyString_ConcatAndDel(register PyObject** pv, register PyObject* w) noexcept {
PyString_Concat(pv, w);
Py_XDECREF(w);
}
static PyObject* string_expandtabs(PyStringObject* self, PyObject* args) noexcept {
......
......@@ -1385,7 +1385,7 @@ inline BORROWED(Box*) Box::getattrString(const char* attr) {
inline void ExcInfo::clear() {
Py_DECREF(type);
Py_DECREF(value);
Py_DECREF(traceback); // XDECREF?
Py_XDECREF(traceback);
}
} // namespace pyston
......
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