parser = ConfigParser()
for filename in filenames:
if DEBUG:
- self.announce(" reading", filename)
+ self.announce(" reading %s" % filename)
parser.read(filename)
for section in parser.sections():
options = parser.options(section)
self.threshold = threshold
def _log(self, level, msg, args):
+ if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
+ raise ValueError('%s wrong log level' % str(level))
+
if level >= self.threshold:
if args:
msg = msg % args
import tempfile
from distutils import log
+from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL
from distutils.core import Distribution
from test.support import EnvironmentVarGuard
super().tearDown()
def _log(self, level, msg, args):
+ if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
+ raise ValueError('%s wrong log level' % str(level))
self.logs.append((level, msg, args))
def get_logs(self, *levels):
self.assertEquals(cmds, ['distutils.command', 'one', 'two'])
+ def test_announce(self):
+ # make sure the level is known
+ dist = Distribution()
+ args = ('ok',)
+ kwargs = {'level': 'ok2'}
+ self.assertRaises(ValueError, dist.announce, args, kwargs)
+
class MetadataTestCase(support.TempdirManager, support.EnvironGuard,
unittest.TestCase):
Library
-------
+- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
+
- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...)
does now always result in NULL.