fix a few bugs and remove unused imports
This commit is contained in:
parent
b877310f02
commit
d3a31fc72d
6 changed files with 3 additions and 7 deletions
|
@ -12,7 +12,6 @@
|
|||
import os
|
||||
|
||||
from . import TokenParser
|
||||
from ..compat import u
|
||||
|
||||
|
||||
FILES = {
|
||||
|
|
|
@ -30,7 +30,6 @@ class CustomEncoder(json.JSONEncoder):
|
|||
try:
|
||||
encoded = super(CustomEncoder, self).default(obj)
|
||||
except UnicodeDecodeError:
|
||||
encoding = sys.getfilesystemencoding()
|
||||
obj = u(obj)
|
||||
encoded = super(CustomEncoder, self).default(obj)
|
||||
return encoded
|
||||
|
@ -63,7 +62,7 @@ class JsonFormatter(logging.Formatter):
|
|||
return CustomEncoder().encode(data)
|
||||
|
||||
def formatException(self, exc_info):
|
||||
return exec_info[2].format_exc()
|
||||
return sys.exec_info[2].format_exc()
|
||||
|
||||
|
||||
def set_log_level(logger, args):
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
from .projects.git import Git
|
||||
from .projects.mercurial import Mercurial
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
||||
log = logging.getLogger('WakaTime')
|
||||
|
|
|
@ -34,7 +34,7 @@ class WakaTime(BaseProject):
|
|||
with open(self.config, 'r', encoding='utf-8') as fh:
|
||||
self._project_name = u(fh.readline().strip())
|
||||
self._project_branch = u(fh.readline().strip())
|
||||
except IOError as e:
|
||||
except IOError:
|
||||
log.exception("Exception:")
|
||||
|
||||
return True
|
||||
|
|
|
@ -65,7 +65,7 @@ def guess_language_from_extension(extension):
|
|||
if extension in EXTENSIONS:
|
||||
return EXTENSIONS[extension]
|
||||
if extension.lower() in EXTENSIONS:
|
||||
return mapping[EXTENSIONS.lower()]
|
||||
return EXTENSIONS[extension.lower()]
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue