def _warn_potentially_incompatible_py_version_if_necessary(model_py_version): if model_py_version is None: eprint("The specified model does not have a specified Python version. It may be" " incompatible with the version of Python that is currently running:" " Python {version}".format( version=PYTHON_VERSION)) elif get_major_minor_py_version(model_py_version) != get_major_minor_py_version(PYTHON_VERSION): eprint("The version of Python that the model was saved in, Python {model_version}, differs" " from the version of Python that is currently running, Python {system_version}," " and may be incompatible".format( model_version=model_py_version, system_version=PYTHON_VERSION))
def _warn_potentially_incompatible_py_version_if_necessary(model_py_version): if model_py_version is None: _logger.warning( "The specified model does not have a specified Python version. It may be" " incompatible with the version of Python that is currently running: Python %s", PYTHON_VERSION) elif get_major_minor_py_version( model_py_version) != get_major_minor_py_version(PYTHON_VERSION): _logger.warning( "The version of Python that the model was saved in, `Python %s`, differs" " from the version of Python that is currently running, `Python %s`," " and may be incompatible", model_py_version, PYTHON_VERSION)
def _warn_potentially_incompatible_py_version_if_necessary(model_py_version=None): """ Compares the version of Python that was used to save a given model with the version of Python that is currently running. If a major or minor version difference is detected, logs an appropriate warning. """ if model_py_version is None: _logger.warning( "The specified model does not have a specified Python version. It may be" " incompatible with the version of Python that is currently running: Python %s", PYTHON_VERSION) elif get_major_minor_py_version(model_py_version) != get_major_minor_py_version(PYTHON_VERSION): _logger.warning( "The version of Python that the model was saved in, `Python %s`, differs" " from the version of Python that is currently running, `Python %s`," " and may be incompatible", model_py_version, PYTHON_VERSION)