Commit de459427 authored by Stefan Behnel's avatar Stefan Behnel

make refnanny output easier to detect when used outside of doctests, print...

make refnanny output easier to detect when used outside of doctests, print number of references leaked
parent 08cdce7b
......@@ -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
......
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