Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1429)

Unified Diff: third_party/logilab/common/logging_ext.py

Issue 719313003: Revert "pylint: upgrade to 1.3.1" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/logilab/common/hg.py ('k') | third_party/logilab/common/modutils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/common/logging_ext.py
diff --git a/third_party/logilab/common/logging_ext.py b/third_party/logilab/common/logging_ext.py
index 3b6a580a0cd2811b52c9e24febdbb408114e697b..1b7a1e60950ba178ede6c3c65b2985e44220b9b3 100644
--- a/third_party/logilab/common/logging_ext.py
+++ b/third_party/logilab/common/logging_ext.py
@@ -24,8 +24,6 @@ import os
import sys
import logging
-from six import string_types
-
from logilab.common.textutils import colorize_ansi
@@ -114,11 +112,7 @@ def get_handler(debug=False, syslog=False, logfile=None, rotation_parameters=Non
else:
try:
if rotation_parameters is None:
- if os.name == 'posix' and sys.version_info >= (2, 6):
- from logging.handlers import WatchedFileHandler
- handler = WatchedFileHandler(logfile)
- else:
- handler = logging.FileHandler(logfile)
+ handler = logging.FileHandler(logfile)
else:
from logging.handlers import TimedRotatingFileHandler
handler = TimedRotatingFileHandler(
@@ -133,25 +127,14 @@ def get_threshold(debug=False, logthreshold=None):
logthreshold = logging.DEBUG
else:
logthreshold = logging.ERROR
- elif isinstance(logthreshold, string_types):
+ elif isinstance(logthreshold, basestring):
logthreshold = getattr(logging, THRESHOLD_MAP.get(logthreshold,
logthreshold))
return logthreshold
-def _colorable_terminal():
- isatty = hasattr(sys.__stdout__, 'isatty') and sys.__stdout__.isatty()
- if not isatty:
- return False
- if os.name == 'nt':
- try:
- from colorama import init as init_win32_colors
- except ImportError:
- return False
- init_win32_colors()
- return True
-
def get_formatter(logformat=LOG_FORMAT, logdateformat=LOG_DATE_FORMAT):
- if _colorable_terminal():
+ isatty = hasattr(sys.__stdout__, 'isatty') and sys.__stdout__.isatty()
+ if isatty and sys.platform != 'win32':
fmt = ColorFormatter(logformat, logdateformat)
def col_fact(record):
if 'XXX' in record.message:
« no previous file with comments | « third_party/logilab/common/hg.py ('k') | third_party/logilab/common/modutils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698