mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Avoid “error: None” messages from distutils (#4931).
Thanks to Amaury Forgeot d’Arc and Philip J. Eby.
This commit is contained in:
parent
ed5d95b76b
commit
fc773a2d4b
6 changed files with 20 additions and 38 deletions
|
@ -8,7 +8,8 @@ from test.support import run_unittest
|
|||
from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError
|
||||
from distutils.util import (get_platform, convert_path, change_root,
|
||||
check_environ, split_quoted, strtobool,
|
||||
rfc822_escape, byte_compile)
|
||||
rfc822_escape, byte_compile,
|
||||
grok_environment_error)
|
||||
from distutils import util # used to patch _environ_checked
|
||||
from distutils.sysconfig import get_config_vars
|
||||
from distutils import sysconfig
|
||||
|
@ -285,6 +286,13 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
finally:
|
||||
sys.dont_write_bytecode = old_dont_write_bytecode
|
||||
|
||||
def test_grok_environment_error(self):
|
||||
# test obsolete function to ensure backward compat (#4931)
|
||||
exc = IOError("Unable to find batch file")
|
||||
msg = grok_environment_error(exc)
|
||||
self.assertEqual(msg, "error: Unable to find batch file")
|
||||
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(UtilTestCase)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue