404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.119.112.143: ~ $
import os
from distutils.msvc9compiler import MSVCCompiler as _MSVCCompiler

from .system_info import platform_bits


def _merge(old, new):
    """Concatenate two environment paths avoiding repeats.

    Here `old` is the environment string before the base class initialize
    function is called and `new` is the string after the call. The new string
    will be a fixed string if it is not obtained from the current environment,
    or the same as the old string if obtained from the same environment. The aim
    here is not to append the new string if it is already contained in the old
    string so as to limit the growth of the environment string.

    Parameters
    ----------
    old : string
        Previous environment string.
    new : string
        New environment string.

    Returns
    -------
    ret : string
        Updated environment string.

    """
    if not old:
        return new
    if new in old:
        return old

    # Neither new nor old is empty. Give old priority.
    return ';'.join([old, new])


class MSVCCompiler(_MSVCCompiler):
    def __init__(self, verbose=0, dry_run=0, force=0):
        _MSVCCompiler.__init__(self, verbose, dry_run, force)

    def initialize(self, plat_name=None):
        # The 'lib' and 'include' variables may be overwritten
        # by MSVCCompiler.initialize, so save them for later merge.
        environ_lib = os.getenv('lib')
        environ_include = os.getenv('include')
        _MSVCCompiler.initialize(self, plat_name)

        # Merge current and previous values of 'lib' and 'include'
        os.environ['lib'] = _merge(environ_lib, os.environ['lib'])
        os.environ['include'] = _merge(environ_include, os.environ['include'])

        # msvc9 building for 32 bits requires SSE2 to work around a
        # compiler bug.
        if platform_bits == 32:
            self.compile_options += ['/arch:SSE2']
            self.compile_options_debug += ['/arch:SSE2']

    def manifest_setup_ldargs(self, output_filename, build_temp, ld_args):
        ld_args.append('/MANIFEST')
        _MSVCCompiler.manifest_setup_ldargs(self, output_filename,
                                            build_temp, ld_args)

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
checks Folder 0755
command Folder 0755
fcompiler Folder 0755
mingw Folder 0755
tests Folder 0755
__config__.py File 5.02 KB 0644
__init__.py File 2.03 KB 0644
__init__.pyi File 119 B 0644
_shell_utils.py File 2.55 KB 0644
armccompiler.py File 962 B 0644
ccompiler.py File 27.95 KB 0644
ccompiler_opt.py File 97.98 KB 0644
conv_template.py File 9.31 KB 0644
core.py File 7.98 KB 0644
cpuinfo.py File 22.11 KB 0644
exec_command.py File 10.04 KB 0644
extension.py File 3.48 KB 0644
from_template.py File 7.73 KB 0644
fujitsuccompiler.py File 834 B 0644
intelccompiler.py File 4.13 KB 0644
lib2def.py File 3.54 KB 0644
line_endings.py File 1.98 KB 0644
log.py File 2.81 KB 0644
mingw32ccompiler.py File 21.55 KB 0644
misc_util.py File 87.26 KB 0644
msvc9compiler.py File 2.14 KB 0644
msvccompiler.py File 2.58 KB 0644
npy_pkg_config.py File 12.67 KB 0644
numpy_distribution.py File 634 B 0644
pathccompiler.py File 713 B 0644
setup.py File 634 B 0644
system_info.py File 110.53 KB 0644
unixccompiler.py File 5.3 KB 0644