Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment:

The change that I made was in the wrong place - it should have been in
the setLevel rather than in basicConfig itself. However, this would not
have covered setLevel for Handlers...

That setLevel behaves differently to basicConfig for the level argument
could be seen as a bug. ISTM I should add a function _checkLevel as follows:

def _checkLevel(level):
    if isinstance(level, int):
        rv = level
    elif str(level) == level:
        if level not in _levelNames:
            raise ValueError("Unknown level: %r" % level)
        rv = _levelNames[level]
    else:
        raise TypeError("Level not an integer or a valid string: %r" %
level)
    return rv


and then have all setLevel(level) methods do a "level =
_checkLevel(level)" before actually setting the level.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6314>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to