This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients dstufft, eric.araujo, lemburg
Date 2015-04-30.15:15:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430406948.34.0.89684475541.issue24083@psf.upfronthosting.co.za>
In-reply-to
Content
Trying to use .get_msvc_path() on an distutils.msvccompiler.MSVCCompiler() instance raises an AttributeError:

MSVCCompiler instance has no attribute '_MSVCCompiler__root'

The reason seems to be that self.__root is not set for Win x64 in .__init__().

Here's an example from Python 2.7.9:

>>> from distutils.msvccompiler import *
>>> c = OldMSVCCompiler()
>>> vars(c)
{'force': 0, 'verbose': 0, 'dry_run': 0, 'runtime_library_dirs': [], 'libraries': [], 'macros': [], 'objects': [], 'output_dir': None, '_MSVCCompiler__product': 'Microsoft SDK compiler 15.0', 'initialized': False, '_MSVCCompiler__arch': 'AMD64', '_MSVCCompiler__version': 9.0, 'library_dirs': [], 'include_dirs': []}
>>> c.get_msvc_paths('include')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python27\lib\distutils\msvccompiler.py", line 615, in get_msvc_paths
    % (self.__root, self.__version))
AttributeError: MSVCCompiler instance has no attribute '_MSVCCompiler__root'

The newer implementation of MSVCCompiler in msvc9compiler doesn't have this method, so cannot be used to find the include and library paths.
History
Date User Action Args
2015-04-30 15:15:48lemburgsetrecipients: + lemburg, eric.araujo, dstufft
2015-04-30 15:15:48lemburgsetmessageid: <1430406948.34.0.89684475541.issue24083@psf.upfronthosting.co.za>
2015-04-30 15:15:48lemburglinkissue24083 messages
2015-04-30 15:15:47lemburgcreate