Remove logics for old Python versions
Python 2.y and Python <= 3.2 are no longer supported, so we no longer need to maintain logics for such old versions. Also the check_python_version method is removed by this change, because the required python version is now enforced by setup.cfg. Change-Id: Ifc5e618a791bdf591e0ec61075089dd992c73e0c
This commit is contained in:
parent
023d15b302
commit
5535153d8e
@ -39,11 +39,6 @@ def die(message, *args):
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def check_python_version():
|
||||
if sys.version_info < (2, 7):
|
||||
die("Need Python Version >= 2.7")
|
||||
|
||||
|
||||
def run_command(cmd, redirect_output=True, check_exit_code=True):
|
||||
"""
|
||||
Runs a command in an out-of-process shell, returning the
|
||||
@ -137,7 +132,6 @@ def print_help():
|
||||
|
||||
|
||||
def main(argv):
|
||||
check_python_version()
|
||||
check_dependencies()
|
||||
create_virtualenv()
|
||||
install_dependencies()
|
||||
|
@ -19,7 +19,6 @@ import configparser
|
||||
import csv
|
||||
import io
|
||||
import re
|
||||
import sys
|
||||
|
||||
import xmltodict
|
||||
import yaml
|
||||
@ -229,11 +228,7 @@ class IniCodec(StreamCodec):
|
||||
return buf
|
||||
|
||||
def _init_config_parser(self, sections=None):
|
||||
# SafeConfigParser was deprecated in Python 3.2
|
||||
if sys.version_info >= (3, 2):
|
||||
parser = configparser.ConfigParser(allow_no_value=True)
|
||||
else:
|
||||
parser = configparser.SafeConfigParser(allow_no_value=True)
|
||||
if sections:
|
||||
for section in sections:
|
||||
parser.add_section(section)
|
||||
@ -452,10 +447,7 @@ class KeyValueCodec(StreamCodec):
|
||||
# Note(zhaochao): In Python 3, when files are opened in text mode,
|
||||
# newlines will be translated to '\n' by default, so we just split
|
||||
# the stream by '\n'.
|
||||
if sys.version_info[0] >= 3:
|
||||
lines = stream.split('\n')
|
||||
else:
|
||||
lines = stream.split(self._line_terminator)
|
||||
|
||||
result = {}
|
||||
for line in lines:
|
||||
|
Loading…
Reference in New Issue
Block a user