remove waitForKeyPress on windows
One should just use 'pause' command in a batch script wait to for key press, no need for ttx to do anything. Fixes #2507
This commit is contained in:
parent
f7653a577d
commit
7c38f3d393
@ -387,15 +387,6 @@ def process(jobs, options):
|
||||
action(input, output, options)
|
||||
|
||||
|
||||
def waitForKeyPress():
|
||||
"""Force the DOS Prompt window to stay open so the user gets
|
||||
a chance to see what's wrong."""
|
||||
import msvcrt
|
||||
print('(Hit any key to exit)', file=sys.stderr)
|
||||
while not msvcrt.kbhit():
|
||||
pass
|
||||
|
||||
|
||||
def main(args=None):
|
||||
"""Convert OpenType fonts to XML and back"""
|
||||
from fontTools import configLogger
|
||||
@ -416,16 +407,12 @@ def main(args=None):
|
||||
log.error("(Cancelled.)")
|
||||
sys.exit(1)
|
||||
except SystemExit:
|
||||
if sys.platform == "win32":
|
||||
waitForKeyPress()
|
||||
raise
|
||||
except TTLibError as e:
|
||||
log.error(e)
|
||||
sys.exit(1)
|
||||
except:
|
||||
log.exception('Unhandled exception has occurred')
|
||||
if sys.platform == "win32":
|
||||
waitForKeyPress()
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
@ -961,10 +961,6 @@ def test_main_keyboard_interrupt(tmpdir, monkeypatch, caplog):
|
||||
assert "(Cancelled.)" in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.platform == "win32",
|
||||
reason="waitForKeyPress function causes test to hang on Windows platform",
|
||||
)
|
||||
def test_main_system_exit(tmpdir, monkeypatch):
|
||||
with pytest.raises(SystemExit):
|
||||
inpath = os.path.join("Tests", "ttx", "data", "TestTTF.ttx")
|
||||
@ -991,10 +987,6 @@ def test_main_ttlib_error(tmpdir, monkeypatch, caplog):
|
||||
assert "Test error" in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.platform == "win32",
|
||||
reason="waitForKeyPress function causes test to hang on Windows platform",
|
||||
)
|
||||
def test_main_base_exception(tmpdir, monkeypatch, caplog):
|
||||
with pytest.raises(SystemExit):
|
||||
inpath = os.path.join("Tests", "ttx", "data", "TestTTF.ttx")
|
||||
|
Loading…
x
Reference in New Issue
Block a user