Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/numpy/distutils/msvccompiler.py
7757 views
import os1from distutils.msvccompiler import MSVCCompiler as _MSVCCompiler23from .system_info import platform_bits456def _merge(old, new):7"""Concatenate two environment paths avoiding repeats.89Here `old` is the environment string before the base class initialize10function is called and `new` is the string after the call. The new string11will be a fixed string if it is not obtained from the current environment,12or the same as the old string if obtained from the same environment. The aim13here is not to append the new string if it is already contained in the old14string so as to limit the growth of the environment string.1516Parameters17----------18old : string19Previous environment string.20new : string21New environment string.2223Returns24-------25ret : string26Updated environment string.2728"""29if new in old:30return old31if not old:32return new3334# Neither new nor old is empty. Give old priority.35return ';'.join([old, new])363738class MSVCCompiler(_MSVCCompiler):39def __init__(self, verbose=0, dry_run=0, force=0):40_MSVCCompiler.__init__(self, verbose, dry_run, force)4142def initialize(self):43# The 'lib' and 'include' variables may be overwritten44# by MSVCCompiler.initialize, so save them for later merge.45environ_lib = os.getenv('lib', '')46environ_include = os.getenv('include', '')47_MSVCCompiler.initialize(self)4849# Merge current and previous values of 'lib' and 'include'50os.environ['lib'] = _merge(environ_lib, os.environ['lib'])51os.environ['include'] = _merge(environ_include, os.environ['include'])5253# msvc9 building for 32 bits requires SSE2 to work around a54# compiler bug.55if platform_bits == 32:56self.compile_options += ['/arch:SSE2']57self.compile_options_debug += ['/arch:SSE2']585960