changeset: 104599:6d20d6fe9b41 branch: 3.6 parent: 104595:b811ec148337 user: INADA Naoki date: Fri Oct 21 12:30:15 2016 +0900 files: Lib/asyncio/futures.py Lib/asyncio/windows_events.py Misc/NEWS PCbuild/_asyncio.vcxproj PCbuild/_asyncio.vcxproj.filters PCbuild/pcbuild.proj PCbuild/pcbuild.sln PCbuild/pythoncore.vcxproj description: Issue #28448: Fix C implemented asyncio.Future didn't work on Windows diff -r b811ec148337 -r 6d20d6fe9b41 Lib/asyncio/futures.py --- a/Lib/asyncio/futures.py Thu Oct 20 21:45:49 2016 +0000 +++ b/Lib/asyncio/futures.py Fri Oct 21 12:30:15 2016 +0900 @@ -247,10 +247,10 @@ if self._state != _PENDING: return False self._state = _CANCELLED - self._schedule_callbacks() + self.__schedule_callbacks() return True - def _schedule_callbacks(self): + def __schedule_callbacks(self): """Internal: Ask the event loop to call all callbacks. The callbacks are scheduled to be called as soon as possible. Also @@ -352,7 +352,7 @@ raise InvalidStateError('{}: {!r}'.format(self._state, self)) self._result = result self._state = _FINISHED - self._schedule_callbacks() + self.__schedule_callbacks() def set_exception(self, exception): """Mark the future done and set an exception. @@ -369,7 +369,7 @@ "and cannot be raised into a Future") self._exception = exception self._state = _FINISHED - self._schedule_callbacks() + self.__schedule_callbacks() if compat.PY34: self._log_traceback = True else: diff -r b811ec148337 -r 6d20d6fe9b41 Lib/asyncio/windows_events.py --- a/Lib/asyncio/windows_events.py Thu Oct 20 21:45:49 2016 +0000 +++ b/Lib/asyncio/windows_events.py Fri Oct 21 12:30:15 2016 +0900 @@ -171,8 +171,13 @@ def cancel(self): raise RuntimeError("_WaitCancelFuture must not be cancelled") - def _schedule_callbacks(self): - super(_WaitCancelFuture, self)._schedule_callbacks() + def set_result(self, result): + super().set_result(result) + if self._done_callback is not None: + self._done_callback(self) + + def set_exception(self, exception): + super().set_exception(exception) if self._done_callback is not None: self._done_callback(self) diff -r b811ec148337 -r 6d20d6fe9b41 Misc/NEWS --- a/Misc/NEWS Thu Oct 20 21:45:49 2016 +0000 +++ b/Misc/NEWS Fri Oct 21 12:30:15 2016 +0900 @@ -20,6 +20,8 @@ Library ------- +- Issue #28448: Fix C implemented asyncio.Future didn't work on Windows. + - Issue #28480: Fix error building socket module when multithreading is disabled. diff -r b811ec148337 -r 6d20d6fe9b41 PCbuild/_asyncio.vcxproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCbuild/_asyncio.vcxproj Fri Oct 21 12:30:15 2016 +0900 @@ -0,0 +1,77 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + PGInstrument + Win32 + + + PGInstrument + x64 + + + PGUpdate + Win32 + + + PGUpdate + x64 + + + Release + Win32 + + + Release + x64 + + + + {384C224A-7474-476E-A01B-750EA7DE918C} + _asyncio + Win32Proj + + + + + DynamicLibrary + NotSet + + + + .pyd + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + + + {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} + false + + + + + + diff -r b811ec148337 -r 6d20d6fe9b41 PCbuild/_asyncio.vcxproj.filters --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCbuild/_asyncio.vcxproj.filters Fri Oct 21 12:30:15 2016 +0900 @@ -0,0 +1,16 @@ + + + + + + + + {2422278e-eeeb-4241-8182-433e2bc5a7fc} + + + + + Source Files + + + \ No newline at end of file diff -r b811ec148337 -r 6d20d6fe9b41 PCbuild/pcbuild.proj --- a/PCbuild/pcbuild.proj Thu Oct 20 21:45:49 2016 +0000 +++ b/PCbuild/pcbuild.proj Fri Oct 21 12:30:15 2016 +0900 @@ -51,7 +51,7 @@ - + diff -r b811ec148337 -r 6d20d6fe9b41 PCbuild/pcbuild.sln --- a/PCbuild/pcbuild.sln Thu Oct 20 21:45:49 2016 +0000 +++ b/PCbuild/pcbuild.sln Fri Oct 21 12:30:15 2016 +0900 @@ -94,6 +94,8 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testconsole", "_testconsole.vcxproj", "{B244E787-C445-441C-BDF4-5A4F1A3A1E51}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_asyncio", "_asyncio.vcxproj", "{384C224A-7474-476E-A01B-750EA7DE918C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 diff -r b811ec148337 -r 6d20d6fe9b41 PCbuild/pythoncore.vcxproj --- a/PCbuild/pythoncore.vcxproj Thu Oct 20 21:45:49 2016 +0000 +++ b/PCbuild/pythoncore.vcxproj Fri Oct 21 12:30:15 2016 +0900 @@ -213,7 +213,6 @@ -