Files
typeshed/third_party
Richard Hansen 1abd14bbcd Allow old-style exception types for backported Future. (#946)
third_party/2/concurrent/futures is for the Python 2 backport of the
concurrent.futures package from Python 3.  In Python 3, all exceptions
are derived from BaseException, but Python 2 also supports exceptions
that are old-style objects (which don't derive from BaseException).
Switch from BaseException to Any to allow old-style exceptions.

All old-style objects are instances of types.InstanceType, so an
alternative to Any is Union[BaseException, types.InstanceType].  This
would help avoid accidentally passing a non-BaseException new-style
object to Future.set_exception().  However, only Executors call that
function (usually), and it's not clear that mypy understands old-style
objects and their relationship to types.InstanceType, so Any is
thought to be the more practical choice.
2017-03-14 09:35:06 -07:00
..