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

@@ -17,9 +17,11 @@ is_py2 = (sys.version_info[0] == 2)
is_py3 = (sys.version_info[0] == 3)
if is_py2:
if is_py2: # pragma: nocover
def u(text):
if text is None:
return None
try:
return text.decode('utf-8')
except:
@@ -31,18 +33,21 @@ if is_py2:
basestring = basestring
elif is_py3:
elif is_py3: # pragma: nocover
def u(text):
if text is None:
return None
if isinstance(text, bytes):
return text.decode('utf-8')
return str(text)
open = open
basestring = (str, bytes)
try:
from importlib import import_module
except ImportError:
except ImportError: # pragma: nocover
def _resolve_name(name, package, level):
"""Return the absolute name of the module to be imported."""
if not hasattr(package, 'rindex'):