Skip to content

Commit a85fef2

Browse files
committed
Python 3 preparation: avoid logging._levelNames.
logging._levelNames is an internal name, not a public interface, and is not available in current Python 3. Fortunately, logger.setLevel accepts strings for log levels, not just numeric levels, in 2.7 (although that change is not mentioned in the 2.7 documentation).
1 parent 2332e6c commit a85fef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roundup/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ def init_logging(self):
16251625
h.close()
16261626
logger.removeHandler(hdlr)
16271627
logger.handlers = [hdlr]
1628-
logger.setLevel(logging._levelNames[self["LOGGING_LEVEL"] or "ERROR"])
1628+
logger.setLevel(self["LOGGING_LEVEL"] or "ERROR")
16291629

16301630
def load(self, home_dir):
16311631
"""Load configuration from path designated by home_dir argument"""

0 commit comments

Comments
 (0)