Skip to content

Commit

Permalink
AttributeError chaining bug pytest-dev#1944 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Maximov committed Sep 18, 2016
1 parent 2bafa74 commit cfc955c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions _pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,10 @@ class PyobjContext(object):
class PyobjMixin(PyobjContext):
def obj():
def fget(self):
try:
return self._obj
except AttributeError:
obj = getattr(self, '_obj', None)
if obj is None:
self._obj = obj = self._getobj()
return obj
return obj
def fset(self, value):
self._obj = value
return property(fget, fset, None, "underlying python object")
Expand Down

0 comments on commit cfc955c

Please sign in to comment.