Fix starting with Python 2

Fixes #2567
This commit is contained in:
Florian Bruhin 2017-04-28 20:51:38 +02:00
parent a5b1c293a4
commit 8101fe99a8
2 changed files with 15 additions and 2 deletions

View File

@ -23,7 +23,6 @@ import sys
import json
import qutebrowser
from qutebrowser.utils import log
try:
from qutebrowser.misc.checkpyver import check_python_version
except ImportError:
@ -38,6 +37,7 @@ except ImportError:
sys.stderr.flush()
sys.exit(100)
check_python_version()
from qutebrowser.utils import log
import argparse
from qutebrowser.misc import earlyinit
@ -130,7 +130,7 @@ def directory(arg):
raise argparse.ArgumentTypeError("Invalid empty value")
def logfilter_error(logfilter: str):
def logfilter_error(logfilter):
"""Validate logger names passed to --logfilter.
Args:

View File

@ -19,6 +19,7 @@
"""Test starting qutebrowser with special arguments/environments."""
import subprocess
import socket
import sys
import logging
@ -254,3 +255,15 @@ def test_command_on_start(request, quteproc_new):
quteproc_new.start(args)
quteproc_new.send_cmd(':quit')
quteproc_new.wait_for_quit()
def test_launching_with_python2():
try:
proc = subprocess.Popen(['python2', '-m', 'qutebrowser',
'--no-err-windows'], stderr=subprocess.PIPE)
except FileNotFoundError:
pytest.skip("python2 not found")
_stdout, stderr = proc.communicate()
assert proc.returncode == 1
error = "At least Python 3.4 is required to run qutebrowser"
assert stderr.decode('ascii').startswith(error)