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.

classification
Title: test_msvc9compiler fails on VC6
Type: Stage:
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, ocean-city
Priority: normal Keywords: easy, patch

Created on 2009-01-07 06:04 by ocean-city, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_msvc9compiler.patch ocean-city, 2009-01-07 09:31 take2
Messages (5)
msg79301 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-01-07 06:04
Currently, test_msvc9compiler fails on VC6 with following message.

//////////////////////////////////////////

Traceback (most recent call last):
  File "test_distutils.py", line 17, in <module>
    test_main()
  File "test_distutils.py", line 13, in test_main
    test.test_support.run_unittest(distutils.tests.test_suite())
  File "e:\python-dev\trunk\lib\test\test_support.py", line 710, in 
run_unittest

    _run_suite(suite)
  File "e:\python-dev\trunk\lib\test\test_support.py", line 693, in 
_run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "e:\python-dev\trunk\lib\distutils\tests\test_msvc9compiler.py", 
line 16,
 in test_no_compiler
    from distutils.msvc9compiler import query_vcvarsall
  File "e:\python-dev\trunk\lib\distutils\msvc9compiler.py", line 281, 
in <modul
e>
    raise DistutilsPlatformError("VC %0.1f is not supported by this 
module" % VE
RSION)
DistutilsPlatformError: VC 6.0 is not supported by this module

//////////////////////////////////////////

I think attached patch will fix this. Is this fix appropriate?

Thank you.
msg79307 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-01-07 08:54
I don't like this catch-all approach. What if no compiler is installed
at all?
I suggest to use a test like
    distutils.msvccompiler.get_build_version() >= 8.0
(this is how msvccompiler imports the msvc9compiler module)
msg79310 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-01-07 09:31
> I don't like this catch-all approach.

I agree with you. Lib/distutils/msvc9compiler.py still only have one 
top level DistutilsPlatformError,

VERSION = get_build_version()
if VERSION < 8.0:
    raise DistutilsPlatformError("VC %0.1f is not supported by this 
module" % VERSION)

but it's not guranteed in future. How abount the new patch?
msg79313 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-01-07 09:38
The patch is good.
msg79314 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-01-07 09:49
Thanks, fixed in r68373.
History
Date User Action Args
2022-04-11 14:56:43adminsetgithub: 49114
2009-01-07 09:49:56ocean-citysetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg79314
2009-01-07 09:38:32amaury.forgeotdarcsetkeywords: - needs review
resolution: accepted
messages: + msg79313
2009-01-07 09:31:24ocean-citysetfiles: + test_msvc9compiler.patch
messages: + msg79310
2009-01-07 09:22:05ocean-citysetfiles: - test_msvc9compiler.patch
2009-01-07 08:54:49amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg79307
2009-01-07 06:10:50ocean-citysetfiles: + test_msvc9compiler.patch
2009-01-07 06:10:41ocean-citysetfiles: - test_msvc9compiler.patch
2009-01-07 06:04:32ocean-citycreate