本文整理汇总了Python中pkg_resources.extern.packaging.version.LegacyVersion方法的典型用法代码示例。如果您正苦于以下问题:Python version.LegacyVersion方法的具体用法?Python version.LegacyVersion怎么用?Python version.LegacyVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pkg_resources.extern.packaging.version
的用法示例。
在下文中一共展示了version.LegacyVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: msvc14_gen_lib_options
# 需要导入模块: from pkg_resources.extern.packaging import version [as 别名]
# 或者: from pkg_resources.extern.packaging.version import LegacyVersion [as 别名]
def msvc14_gen_lib_options(*args, **kwargs):
"""
Patched "distutils._msvccompiler.gen_lib_options" for fix
compatibility between "numpy.distutils" and "distutils._msvccompiler"
(for Numpy < 1.11.2)
"""
if "numpy.distutils" in sys.modules:
import numpy as np
if LegacyVersion(np.__version__) < LegacyVersion('1.11.2'):
return np.distutils.ccompiler.gen_lib_options(*args, **kwargs)
return get_unpatched(msvc14_gen_lib_options)(*args, **kwargs)
示例2: msvc14_gen_lib_options
# 需要导入模块: from pkg_resources.extern.packaging import version [as 别名]
# 或者: from pkg_resources.extern.packaging.version import LegacyVersion [as 别名]
def msvc14_gen_lib_options(*args, **kwargs):
"""
Patched "distutils._msvccompiler.gen_lib_options" for fix
compatibility between "numpy.distutils" and "distutils._msvccompiler"
(for Numpy < 1.11.2)
"""
if "numpy.distutils" in sys.modules:
import numpy as np
if LegacyVersion(np.__version__) < LegacyVersion('1.11.2'):
return np.distutils.ccompiler.gen_lib_options(*args, **kwargs)
return monkey.unpatched['msvc14_gen_lib_options'](*args, **kwargs)