Mercurial > hg
view mercurial/utils/interfaceutil.py @ 40976:ef7119cd4965
py3: enable legacy stdio mode in exewrapper
This drops the test failure count from 166 to 117. The failures were typically
in the form of `hg serve -d` spawning but crashing immediately, leaving clients
with "bad http status" lines, connection refusals, and so forth. The underlying
message on the server side was either "OSError: [WinError 6] The handle is
invalid" or "OSError: [WinError 1] Incorrect function". Additionally, no output
was rendered if the pager was activated. Thanks to Yuya for diagnosing the
problem.
The failure count drops to 107 when PYTHONLEGACYWINDOWSSTDIO=1 is defined in the
environment. These failures seem to revolve around the dummyssh server process,
and dumbhttp.py. So I'll probably add that to the test runner.
One small regression here (only in py3) is that if hg.exe is already built, a
messagebox appears when building it again saying that python37.dll can't be
loaded. Python3 isn't in PATH by default, and setup.py tries running bare `hg`
first. But MSYS prepends '.' to PATH, so it runs the local hg, but can't find
the library. It falls back to the python used to invoke setup.py, so ultimately
it works. I'm not sure if it's better to strip '.' from PATH or just skip right
to `sys.executable hg` on Windows.
Also, something seems to be wrong with run-tests._usecorrectpython(). I
accidentially left off the 'PYTHON="py -3"' when building (thus making py2
stuff), and yet managed to invoke run-tests.py with "py -3". (And that only had
67 failures.)
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 16 Dec 2018 17:42:45 -0500 |
parents | 856f381ad74b |
children |
line wrap: on
line source
# interfaceutil.py - Utilities for declaring interfaces. # # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # zope.interface imposes a run-time cost due to module import overhead and # bookkeeping for declaring interfaces. So, we use stubs for various # zope.interface primitives unless instructed otherwise. from __future__ import absolute_import from .. import ( encoding, ) if encoding.environ.get('HGREALINTERFACES'): from ..thirdparty.zope import ( interface as zi, ) Attribute = zi.Attribute Interface = zi.Interface implementer = zi.implementer else: class Attribute(object): def __init__(self, __name__, __doc__=''): pass class Interface(object): def __init__(self, name, bases=(), attrs=None, __doc__=None, __module__=None): pass def implementer(*ifaces): def wrapper(cls): return cls return wrapper