D2844: commandserver: prefer first-party selectors module from Python 3 to backport
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb3c15f0eb984: commandserver: prefer first-party selectors module from Python 3 to backport (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2844?vs=7001=7025 REVISION DETAIL https://phab.mercurial-scm.org/D2844 AFFECTED FILES mercurial/commandserver.py CHANGE DETAILS diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py --- a/mercurial/commandserver.py +++ b/mercurial/commandserver.py @@ -16,8 +16,13 @@ import struct import traceback +try: +import selectors +selectors.BaseSelector +except ImportError: +from .thirdparty import selectors2 as selectors + from .i18n import _ -from .thirdparty import selectors2 from . import ( encoding, error, @@ -476,8 +481,8 @@ def _mainloop(self): exiting = False h = self._servicehandler -selector = selectors2.DefaultSelector() -selector.register(self._sock, selectors2.EVENT_READ) +selector = selectors.DefaultSelector() +selector.register(self._sock, selectors.EVENT_READ) while True: if not exiting and h.shouldexit(): # clients can no longer connect() to the domain socket, so To: durin42, #hg-reviewers, yuja Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2844: commandserver: prefer first-party selectors module from Python 3 to backport
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Caught by some deprecation warnings on Python 3.7. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2844 AFFECTED FILES mercurial/commandserver.py CHANGE DETAILS diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py --- a/mercurial/commandserver.py +++ b/mercurial/commandserver.py @@ -16,8 +16,13 @@ import struct import traceback +try: +import selectors +selectors.BaseSelector +except ImportError: +from .thirdparty import selectors2 as selectors + from .i18n import _ -from .thirdparty import selectors2 from . import ( encoding, error, @@ -476,8 +481,8 @@ def _mainloop(self): exiting = False h = self._servicehandler -selector = selectors2.DefaultSelector() -selector.register(self._sock, selectors2.EVENT_READ) +selector = selectors.DefaultSelector() +selector.register(self._sock, selectors.EVENT_READ) while True: if not exiting and h.shouldexit(): # clients can no longer connect() to the domain socket, so To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel