Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
5a3897bf
Commit
5a3897bf
authored
Dec 30, 2008
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #4702: Throwing DistutilsPlatformError instead of IOError under win32 if MSVC is not found
parent
48eeeee5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
msvc9compiler.py
msvc9compiler.py
+2
-2
tests/test_msvc9compiler.py
tests/test_msvc9compiler.py
+33
-0
No files found.
msvc9compiler.py
View file @
5a3897bf
...
...
@@ -247,7 +247,7 @@ def query_vcvarsall(version, arch="x86"):
result = {}
if vcvarsall is None:
raise
IO
Error("
Unable
to
find
vcvarsall
.
bat
")
raise
DistutilsPlatform
Error("
Unable
to
find
vcvarsall
.
bat
")
log.debug("
Calling
'vcvarsall.bat %s'
(
version
=%
s
)
", arch, version)
popen = subprocess.Popen('"
%
s
" %s & set' % (vcvarsall, arch),
stdout=subprocess.PIPE,
...
...
@@ -255,7 +255,7 @@ def query_vcvarsall(version, arch="x86"):
stdout, stderr = popen.communicate()
if popen.wait() != 0:
raise
IO
Error(stderr.decode("
mbcs
"))
raise
DistutilsPlatform
Error(stderr.decode("
mbcs
"))
stdout = stdout.decode("
mbcs
")
for line in stdout.split("
\
n
"):
...
...
tests/test_msvc9compiler.py
0 → 100644
View file @
5a3897bf
"""Tests for distutils.msvc9compiler."""
import
sys
import
unittest
from
distutils.errors
import
DistutilsPlatformError
class
msvc9compilerTestCase
(
unittest
.
TestCase
):
def
test_no_compiler
(
self
):
# makes sure query_vcvarsall throws
# a DistutilsPlatformError if the compiler
# is not found
if
sys
.
platform
!=
'win32'
:
# this test is only for win32
return
from
distutils.msvc9compiler
import
query_vcvarsall
def
_find_vcvarsall
(
version
):
return
None
from
distutils
import
msvc9compiler
old_find_vcvarsall
=
msvc9compiler
.
find_vcvarsall
msvc9compiler
.
find_vcvarsall
=
_find_vcvarsall
try
:
self
.
assertRaises
(
DistutilsPlatformError
,
query_vcvarsall
,
'wont find this version'
)
finally
:
msvc9compiler
.
find_vcvarsall
=
old_find_vcvarsall
def
test_suite
():
return
unittest
.
makeSuite
(
msvc9compilerTestCase
)
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment