changeset: 104600:a9a136c9d857 parent: 104598:d4fce64b1c65 parent: 104599:6d20d6fe9b41 user: INADA Naoki date: Fri Oct 21 12:32:46 2016 +0900 files: Misc/NEWS description: Issue #28448: Fix C implemented asyncio.Future didn't work on Windows (merge 3.6) diff -r d4fce64b1c65 -r a9a136c9d857 Lib/asyncio/futures.py --- a/Lib/asyncio/futures.py Fri Oct 21 00:52:04 2016 +0000 +++ b/Lib/asyncio/futures.py Fri Oct 21 12:32:46 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 d4fce64b1c65 -r a9a136c9d857 Lib/asyncio/windows_events.py --- a/Lib/asyncio/windows_events.py Fri Oct 21 00:52:04 2016 +0000 +++ b/Lib/asyncio/windows_events.py Fri Oct 21 12:32:46 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 d4fce64b1c65 -r a9a136c9d857 Misc/NEWS --- a/Misc/NEWS Fri Oct 21 00:52:04 2016 +0000 +++ b/Misc/NEWS Fri Oct 21 12:32:46 2016 +0900 @@ -88,6 +88,8 @@ Library ------- +- Issue #28448: Fix C implemented asyncio.Future didn't work on Windows. + - Issue #23214: In the "io" module, the argument to BufferedReader and BytesIO's read1() methods is now optional and can be -1, matching the BufferedIOBase specification. diff -r d4fce64b1c65 -r a9a136c9d857 PCbuild/_asyncio.vcxproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCbuild/_asyncio.vcxproj Fri Oct 21 12:32:46 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 d4fce64b1c65 -r a9a136c9d857 PCbuild/_asyncio.vcxproj.filters --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCbuild/_asyncio.vcxproj.filters Fri Oct 21 12:32:46 2016 +0900 @@ -0,0 +1,16 @@ + + + + + + + + {2422278e-eeeb-4241-8182-433e2bc5a7fc} + + + + + Source Files + + + \ No newline at end of file diff -r d4fce64b1c65 -r a9a136c9d857 PCbuild/pcbuild.proj --- a/PCbuild/pcbuild.proj Fri Oct 21 00:52:04 2016 +0000 +++ b/PCbuild/pcbuild.proj Fri Oct 21 12:32:46 2016 +0900 @@ -51,7 +51,7 @@ - + diff -r d4fce64b1c65 -r a9a136c9d857 PCbuild/pcbuild.sln --- a/PCbuild/pcbuild.sln Fri Oct 21 00:52:04 2016 +0000 +++ b/PCbuild/pcbuild.sln Fri Oct 21 12:32:46 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 d4fce64b1c65 -r a9a136c9d857 PCbuild/pythoncore.vcxproj --- a/PCbuild/pythoncore.vcxproj Fri Oct 21 00:52:04 2016 +0000 +++ b/PCbuild/pythoncore.vcxproj Fri Oct 21 12:32:46 2016 +0900 @@ -213,7 +213,6 @@ -