From: Stefan Behnel Date: Wed, 26 Sep 2012 19:57:24 +0000 (+0200) Subject: make refnanny output easier to detect when used outside of doctests, print number... X-Git-Tag: 0.18b1~220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de45942734d69fd6b1abbed6e5892e302386bf2c;p=platform%2Fupstream%2Fpython-cython.git make refnanny output easier to detect when used outside of doctests, print number of references leaked --- diff --git a/Cython/Runtime/refnanny.pyx b/Cython/Runtime/refnanny.pyx index 7988c59..3c73803 100644 --- a/Cython/Runtime/refnanny.pyx +++ b/Cython/Runtime/refnanny.pyx @@ -58,12 +58,12 @@ cdef class Context(object): cdef end(self): if self.refs: - msg = u"" + msg = u"References leaked:" for count, linenos in self.refs.itervalues(): - msg += u"\n Acquired on lines: " + u", ".join([u"%d" % x for x in linenos]) - self.errors.append(u"References leaked: %s" % msg) + msg += u"\n (%d) acquired on lines: %s" % (count, u", ".join([u"%d" % x for x in linenos])) + self.errors.append(msg) if self.errors: - return u"\n".join(self.errors) + return u"\n".join(['REFNANNY: '+error for error in self.errors]) else: return None