From 2500c9827886fb1826317877aacaef023707349e Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Sat, 3 Sep 2016 17:04:36 +0100 Subject: [PATCH] Closes #27935: returned numeric value for 'FATAL' logging level. --- Lib/logging/__init__.py | 1 + Lib/test/test_logging.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 0c5c2ec28f9..2590d6528f6 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -108,6 +108,7 @@ _levelToName = { } _nameToLevel = { 'CRITICAL': CRITICAL, + 'FATAL': FATAL, 'ERROR': ERROR, 'WARN': WARNING, 'WARNING': WARNING, diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 7899c77fb96..ff0012beb20 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -309,6 +309,10 @@ class BuiltinLevelsTest(BaseTest): self.assertEqual(logging.getLevelName('INFO'), logging.INFO) self.assertEqual(logging.getLevelName(logging.INFO), 'INFO') + def test_issue27935(self): + fatal = logging.getLevelName('FATAL') + self.assertEqual(fatal, logging.FATAL) + class BasicFilterTest(BaseTest): """Test the bundled Filter class."""