From 5d024c7433939dee6cf56fe4ed829f553bde36b4 Mon Sep 17 00:00:00 2001 From: uweschmitt Date: Mon, 11 Aug 2014 12:42:36 +0200 Subject: [PATCH] hopefully final fix for strange infinite recursion bug --- _pytest/capture.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/_pytest/capture.py b/_pytest/capture.py index f27ab1a74..164d5538b 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -238,12 +238,8 @@ class EncodedFile(object): self.write(data) def __getattr__(self, name): - return getattr(self.buffer, name) - - def __setstate__(self, dd): - """default implementation for __setstate__ because unpickling causes infinite - recursion if only __getattr__ is overloaded and __setstate__ is missing""" - self.__dict__ = dd + if hasattr(self, "buffer"): + return getattr(self.buffer, name) class MultiCapture(object):