upgrade wakatime cli to v4.1.1

This commit is contained in:
Alan Hamlett
2015-08-25 00:42:37 -07:00
parent b07b59e0c8
commit 7ea51d09ba
40 changed files with 622 additions and 448 deletions

View File

@ -11,6 +11,7 @@
import logging
import os
import sys
from .base import BaseProject
from ..compat import u, open
@ -38,8 +39,14 @@ class Git(BaseProject):
try:
with open(head, 'r', encoding='utf-8') as fh:
return u(fh.readline().strip().rsplit('/', 1)[-1])
except UnicodeDecodeError:
try:
with open(head, 'r', encoding=sys.getfilesystemencoding()) as fh:
return u(fh.readline().strip().rsplit('/', 1)[-1])
except:
log.exception("Exception:")
except IOError:
pass
log.exception("Exception:")
return None
def _project_base(self):