Skip to content

Commit b1d535e

Browse files
author
James William Pye
committed
That makes 3.0 crash.
This was apparantly fixed in 3.1, so I imagine py-dev knows about it--I'm not sure it's entirely wise, anyways. I'm thinking about finding the places that use Nested() and getting rid of them.
1 parent 9bd4dc2 commit b1d535e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

postgresql/python/contextlib.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ def __exit__(self, typ, val, tb):
6666
typ = val = tb = None
6767
except:
6868
newtyp, newval, newtb = sys.exc_info()
69-
if getattr(newval,'__cause__') is None:
70-
newval.__cause__ = getattr(newval, '__context__', val)
71-
if newval.__cause__ is newval.__context__:
72-
newval.__context__ = None
69+
if newval.__cause__ is None:
70+
newval.__cause__ = newval.__context__
7371
typ = newtyp
7472
val = newval
7573
tb = newtb

0 commit comments

Comments
 (0)