]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Merge "Ensure all nested exception throws have a cause"
authormike bayer <mike_mp@zzzcomputing.com>
Mon, 2 Mar 2020 23:45:35 +0000 (23:45 +0000)
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>
Mon, 2 Mar 2020 23:45:35 +0000 (23:45 +0000)
1  2 
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/compat.py
test/engine/test_execute.py

Simple merge
index 104e8e03dd6cdf282f85e75372ef988e2cb65ea6,004b4687a638fd0ee08514b5258e3dfcc0a02cd7..31654b97c8b2c07c0c83717bd845fd5beb8d53cc
@@@ -369,7 -398,44 +398,9 @@@ else
      import collections as collections_abc  # noqa
  
  
 -@contextlib.contextmanager
 -def nested(*managers):
 -    """Implement contextlib.nested, mostly for unit tests.
 -
 -    As tests still need to run on py2.6 we can't use multiple-with yet.
 -
 -    Function is removed in py3k but also emits deprecation warning in 2.7
 -    so just roll it here for everyone.
 -
 -    """
 -
 -    exits = []
 -    vars_ = []
 -    exc = (None, None, None)
 -    try:
 -        for mgr in managers:
 -            exit_ = mgr.__exit__
 -            enter = mgr.__enter__
 -            vars_.append(enter())
 -            exits.append(exit_)
 -        yield vars_
 -    except:
 -        exc = sys.exc_info()
 -    finally:
 -        while exits:
 -            exit_ = exits.pop()  # noqa
 -            try:
 -                if exit_(*exc):
 -                    exc = (None, None, None)
 -            except:
 -                exc = sys.exc_info()
 -        if exc != (None, None, None):
 -            reraise(exc[0], exc[1], exc[2])
 -
 -
  def raise_from_cause(exception, exc_info=None):
+     r"""legacy.  use raise\_()"""
      if exc_info is None:
          exc_info = sys.exc_info()
      exc_type, exc_value, exc_tb = exc_info
Simple merge