From e61439b3018b0b9a8eb43e59d0d7cf32041e2fed Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Tue, 27 Sep 2016 16:05:58 +0200 Subject: src: constify is_() calls + TCs: unittest-asserts for git-tests. --- git/compat.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'git/compat.py') diff --git a/git/compat.py b/git/compat.py index 8c5036c6..dced3a5f 100644 --- a/git/compat.py +++ b/git/compat.py @@ -24,6 +24,9 @@ from gitdb.utils.encoding import ( ) PY3 = sys.version_info[0] >= 3 +is_win = (os.name == 'nt') +is_posix = (os.name == 'posix') +is_darwin = (os.name == 'darwin') defenc = sys.getdefaultencoding() if PY3: @@ -78,17 +81,6 @@ def with_metaclass(meta, *bases): return meta(name, bases, d) return metaclass(meta.__name__ + 'Helper', None, {}) -def is_win(): - return os.name == 'nt' - - -def is_posix(): - return os.name == 'posix' - - -def is_darwin(): - return os.name == 'darwin' - ## From https://docs.python.org/3.3/howto/pyporting.html class UnicodeMixin(object): -- cgit v1.2.1