From bd81b6fd6efaf1113f45e2cdad996f6787506eae Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 23 Jan 2019 12:44:08 +0000 Subject: [PATCH] issue #477: %f date format requires Py2.6 or newer. --- mitogen/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mitogen/utils.py b/mitogen/utils.py index 31669ea9..e2820333 100644 --- a/mitogen/utils.py +++ b/mitogen/utils.py @@ -62,7 +62,9 @@ def _formatTime(record, datefmt=None): def log_get_formatter(): - datefmt = '%H:%M:%S.%f' + datefmt = '%H:%M:%S' + if sys.version_info > (2, 6): + datefmt += '.%f' fmt = '%(asctime)s %(levelname).1s %(name)s: %(message)s' formatter = logging.Formatter(fmt, datefmt) formatter.formatTime = _formatTime