本文整理匯總了Python中distutils.msvccompiler.get_build_version方法的典型用法代碼示例。如果您正苦於以下問題:Python msvccompiler.get_build_version方法的具體用法?Python msvccompiler.get_build_version怎麽用?Python msvccompiler.get_build_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類distutils.msvccompiler
的用法示例。
在下文中一共展示了msvccompiler.get_build_version方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: generate_manifest
# 需要導入模塊: from distutils import msvccompiler [as 別名]
# 或者: from distutils.msvccompiler import get_build_version [as 別名]
def generate_manifest(config):
msver = get_build_msvc_version()
if msver is not None:
if msver >= 8:
check_embedded_msvcr_match_linked(msver)
ma = int(msver)
mi = int((msver - ma) * 10)
# Write the manifest file
manxml = msvc_manifest_xml(ma, mi)
man = open(manifest_name(config), "w")
config.temp_files.append(manifest_name(config))
man.write(manxml)
man.close()
# # Write the rc file
# manrc = manifest_rc(manifest_name(self), "exe")
# rc = open(rc_name(self), "w")
# self.temp_files.append(manrc)
# rc.write(manrc)
# rc.close()
示例2: generate_manifest
# 需要導入模塊: from distutils import msvccompiler [as 別名]
# 或者: from distutils.msvccompiler import get_build_version [as 別名]
def generate_manifest(config):
msver = get_build_msvc_version()
if msver is not None:
if msver >= 8:
check_embedded_msvcr_match_linked(msver)
ma = int(msver)
mi = int((msver - ma) * 10)
# Write the manifest file
manxml = msvc_manifest_xml(ma, mi)
man = open(manifest_name(config), "w")
config.temp_files.append(manifest_name(config))
man.write(manxml)
man.close()
示例3: needs_mingw_ftime_workaround
# 需要導入模塊: from distutils import msvccompiler [as 別名]
# 或者: from distutils.msvccompiler import get_build_version [as 別名]
def needs_mingw_ftime_workaround():
# We need the mingw workaround for _ftime if the msvc runtime version is
# 7.1 or above and we build with mingw ...
# ... but we can't easily detect compiler version outside distutils command
# context, so we will need to detect in randomkit whether we build with gcc
msver = get_msvc_build_version()
if msver and msver >= 8:
return True
return False
示例4: get_exe_bytes
# 需要導入模塊: from distutils import msvccompiler [as 別名]
# 或者: from distutils.msvccompiler import get_build_version [as 別名]
def get_exe_bytes (self):
from distutils.msvccompiler import get_build_version
# If a target-version other than the current version has been
# specified, then using the MSVC version from *this* build is no good.
# Without actually finding and executing the target version and parsing
# its sys.version, we just hard-code our knowledge of old versions.
# NOTE: Possible alternative is to allow "--target-version" to
# specify a Python executable rather than a simple version string.
# We can then execute this program to obtain any info we need, such
# as the real sys.version string for the build.
cur_version = get_python_version()
if self.target_version and self.target_version != cur_version:
if self.target_version < "2.3":
raise NotImplementedError
elif self.target_version == "2.3":
bv = "6"
elif self.target_version in ("2.4", "2.5"):
bv = "7.1"
elif self.target_version in ("2.6", "2.7"):
bv = "9.0"
else:
raise NotImplementedError
else:
# for current version - use authoritative check.
bv = get_build_version()
# wininst-x.y.exe is in the same directory as this file
directory = os.path.dirname(__file__)
# we must use a wininst-x.y.exe built with the same C compiler
# used for python. XXX What about mingw, borland, and so on?
# The uninstallers need to be available in $PYEXT_CROSS/uninst/*.exe
# Use http://oss.itsystementwicklung.de/hg/pyext_cross_linux_to_win32/
# and copy it alongside your pysqlite checkout.
filename = os.path.join(directory, os.path.join(os.environ["PYEXT_CROSS"], "uninst", "wininst-%s.exe" % bv))
return open(filename, "rb").read()
# class bdist_wininst
示例5: get_exe_bytes
# 需要導入模塊: from distutils import msvccompiler [as 別名]
# 或者: from distutils.msvccompiler import get_build_version [as 別名]
def get_exe_bytes (self):
from distutils.msvccompiler import get_build_version
# If a target-version other than the current version has been
# specified, then using the MSVC version from *this* build is no good.
# Without actually finding and executing the target version and parsing
# its sys.version, we just hard-code our knowledge of old versions.
# NOTE: Possible alternative is to allow "--target-version" to
# specify a Python executable rather than a simple version string.
# We can then execute this program to obtain any info we need, such
# as the real sys.version string for the build.
cur_version = get_python_version()
if self.target_version and self.target_version != cur_version:
# If the target version is *later* than us, then we assume they
# use what we use
# string compares seem wrong, but are what sysconfig.py itself uses
if self.target_version > cur_version:
bv = get_build_version()
else:
if self.target_version < "2.4":
bv = "6"
else:
bv = "7.1"
else:
# for current version - use authoritative check.
bv = get_build_version()
# wininst-x.y.exe is in the same directory as this file
directory = os.path.dirname(__file__)
# we must use a wininst-x.y.exe built with the same C compiler
# used for python. XXX What about mingw, borland, and so on?
filename = os.path.join(directory, "wininst-%s.exe" % bv)
return open(filename, "rb").read()
# class bdist_wininst