[Python-checkins] cpython: Closes #27935: returned numeric value for 'FATAL' logging level.

vinay.sajip python-checkins at python.org
Sat Sep 3 12:04:43 EDT 2016


https://hg.python.org/cpython/rev/85f9f8bf2ec8
changeset:   103021:85f9f8bf2ec8
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Sat Sep 03 17:04:36 2016 +0100
summary:
  Closes #27935: returned numeric value for 'FATAL' logging level.

files:
  Lib/logging/__init__.py  |  1 +
  Lib/test/test_logging.py |  4 ++++
  2 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -108,6 +108,7 @@
 }
 _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
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -309,6 +309,10 @@
         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."""

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list