def lambda_python_version()

in chalice/config.py [0:0]


    def lambda_python_version(self):
        # type: () -> str
        # We may open this up to configuration later, but for now,
        # we attempt to match your python version to the closest version
        # supported by lambda.
        major, minor = sys.version_info[0], sys.version_info[1]
        if major == 2:
            return 'python2.7'
        # Python 3 for backwards compatibility needs to select python3.6
        # for python versions 3.0-3.6. 3.7 and higher will use python3.7.
        elif (major, minor) <= (3, 6):
            return 'python3.6'
        elif (major, minor) <= (3, 7):
            return 'python3.7'
        elif (major, minor) <= (3, 8):
            return 'python3.8'
        return 'python3.9'