asyncio: Future.set_exception(exc) should instantiate exc if it is a class.
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
index 9ee13e3..d09f423 100644
--- a/Lib/asyncio/futures.py
+++ b/Lib/asyncio/futures.py
@@ -301,6 +301,8 @@
         """
         if self._state != _PENDING:
             raise InvalidStateError('{}: {!r}'.format(self._state, self))
+        if isinstance(exception, type):
+            exception = exception()
         self._exception = exception
         self._state = _FINISHED
         self._schedule_callbacks()