improved test coverage for distutils.cmd
diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
index dfcbe23..0e56460 100644
--- a/Lib/distutils/cmd.py
+++ b/Lib/distutils/cmd.py
@@ -214,7 +214,7 @@
# and they can be guaranteed that thereafter, self.foo will be
# a list of strings.
- def _ensure_stringlike (self, option, what, default=None):
+ def _ensure_stringlike(self, option, what, default=None):
val = getattr(self, option)
if val is None:
setattr(self, option, default)
@@ -224,13 +224,13 @@
"'%s' must be a %s (got `%s`)" % (option, what, val)
return val
- def ensure_string (self, option, default=None):
+ def ensure_string(self, option, default=None):
"""Ensure that 'option' is a string; if not defined, set it to
'default'.
"""
self._ensure_stringlike(option, "string", default)
- def ensure_string_list (self, option):
+ def ensure_string_list(self, option):
"""Ensure that 'option' is a list of strings. If 'option' is
currently a string, we split it either on /,\s*/ or /\s+/, so
"foo bar baz", "foo,bar,baz", and "foo, bar baz" all become
@@ -258,20 +258,20 @@
(option, val)
- def _ensure_tested_string (self, option, tester,
- what, error_fmt, default=None):
+ def _ensure_tested_string(self, option, tester,
+ what, error_fmt, default=None):
val = self._ensure_stringlike(option, what, default)
if val is not None and not tester(val):
raise DistutilsOptionError, \
("error in '%s' option: " + error_fmt) % (option, val)
- def ensure_filename (self, option):
+ def ensure_filename(self, option):
"""Ensure that 'option' is the name of an existing file."""
self._ensure_tested_string(option, os.path.isfile,
"filename",
"'%s' does not exist or is not a file")
- def ensure_dirname (self, option):
+ def ensure_dirname(self, option):
self._ensure_tested_string(option, os.path.isdir,
"directory name",
"'%s' does not exist or is not a directory")