diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-09-26 20:41:41 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-09-27 12:37:16 +0200 |
commit | f495e94028bfddc264727ffc464cd694ddd05ab8 (patch) | |
tree | 8c0bf309b08576f96c9344d9937344e1447d2237 /git/util.py | |
parent | 29eb301700c41f0af7d57d923ad069cbdf636381 (diff) | |
download | gitpython-f495e94028bfddc264727ffc464cd694ddd05ab8.tar.gz |
src, #519: collect all is_<platform>() calls
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/util.py b/git/util.py index b56b96da..31ff94fa 100644 --- a/git/util.py +++ b/git/util.py @@ -6,7 +6,6 @@ import os import re -import sys import time import stat import shutil @@ -26,7 +25,7 @@ from .compat import ( # Most of these are unused here, but are for use by git-python modules so these # don't see gitdb all the time. Flake of course doesn't like it. -from gitdb.util import ( # NOQA +from gitdb.util import (# NOQA make_sha, LockedFD, file_contents_ro, @@ -34,6 +33,7 @@ from gitdb.util import ( # NOQA to_hex_sha, to_bin_sha ) +from git.compat import is_win __all__ = ("stream_copy", "join_path", "to_native_path_windows", "to_native_path_linux", "join_path_native", "Stats", "IndexFileSHA1Writer", "Iterable", "IterableList", @@ -106,7 +106,7 @@ def join_path(a, *p): return path -if sys.platform.startswith('win'): +if is_win(): def to_native_path_windows(path): return path.replace('/', '\\') @@ -587,7 +587,7 @@ class LockFile(object): try: # on bloody windows, the file needs write permissions to be removable. # Why ... - if os.name == 'nt': + if is_win(): os.chmod(lfp, 0o777) # END handle win32 os.remove(lfp) |