def METHOD_NAME(self):
    # Issue #18080:
    # ensure that setting CC env variable also changes default linker
    def gcv(v):
        if v == 'LDSHARED':
            return 'gcc-4.2 -bundle -undefined dynamic_lookup '
        return 'gcc-4.2'
    sysconfig.get_config_var = gcv
    with EnvironmentVarGuard() as env:
        env['CC'] = 'my_cc'
        del env['LDSHARED']
        sysconfig.customize_compiler(self.cc)
    self.assertEqual(self.cc.linker_so[0], 'my_cc')