break reference cycles caused by storing local reference to exception info
Such reference cycles unnecessarily cause Python interpreter not to garbage collect the objects referenced in those cycles as soon they could be collected, and in turn cause the tests to use more memory than is strictly necessary. --HG-- branch : break_ExceptionInfo_reference_cycles
This commit is contained in:
@@ -456,8 +456,8 @@ class Module(pytest.File, PyCollector):
|
||||
try:
|
||||
mod = self.fspath.pyimport(ensuresyspath=True)
|
||||
except SyntaxError:
|
||||
excinfo = py.code.ExceptionInfo()
|
||||
raise self.CollectError(excinfo.getrepr(style="short"))
|
||||
raise self.CollectError(
|
||||
py.code.ExceptionInfo().getrepr(style="short"))
|
||||
except self.fspath.ImportMismatchError:
|
||||
e = sys.exc_info()[1]
|
||||
raise self.CollectError(
|
||||
|
||||
Reference in New Issue
Block a user