summaryrefslogtreecommitdiff
path: root/git/config.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2016-10-22 11:11:25 +0200
committerSebastian Thiel <byronimo@gmail.com>2016-10-22 11:11:25 +0200
commitcaa0ea7a0893fe90ea043843d4e6ad407126d7b8 (patch)
tree2f688eb182f2e76091134c47c4a327681c12e15b /git/config.py
parentafcd64ebbb770908bd2a751279ff070dea5bb97c (diff)
parentcc77e6b2862733a211c55cf29cc7a83c36c27919 (diff)
downloadgitpython-caa0ea7a0893fe90ea043843d4e6ad407126d7b8.tar.gz
Merge branch 'cygwin' of https://github.com/ankostis/GitPython into ankostis-cygwin
Diffstat (limited to 'git/config.py')
-rw-r--r--git/config.py36
1 files changed, 20 insertions, 16 deletions
diff --git a/git/config.py b/git/config.py
index 00943b58..f530bac8 100644
--- a/git/config.py
+++ b/git/config.py
@@ -6,21 +6,13 @@
"""Module containing module parser implementation able to properly read and write
configuration files"""
-import re
-try:
- import ConfigParser as cp
-except ImportError:
- # PY3
- import configparser as cp
+import abc
+from functools import wraps
import inspect
import logging
-import abc
import os
+import re
-from functools import wraps
-
-from git.odict import OrderedDict
-from git.util import LockFile
from git.compat import (
string_types,
FileType,
@@ -29,6 +21,18 @@ from git.compat import (
with_metaclass,
PY3
)
+from git.odict import OrderedDict
+from git.util import LockFile
+
+import os.path as osp
+
+
+try:
+ import ConfigParser as cp
+except ImportError:
+ # PY3
+ import configparser as cp
+
__all__ = ('GitConfigParser', 'SectionConstraint')
@@ -408,15 +412,15 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje
if self._has_includes():
for _, include_path in self.items('include'):
if include_path.startswith('~'):
- include_path = os.path.expanduser(include_path)
- if not os.path.isabs(include_path):
+ include_path = osp.expanduser(include_path)
+ if not osp.isabs(include_path):
if not file_ok:
continue
# end ignore relative paths if we don't know the configuration file path
- assert os.path.isabs(file_path), "Need absolute paths to be sure our cycle checks will work"
- include_path = os.path.join(os.path.dirname(file_path), include_path)
+ assert osp.isabs(file_path), "Need absolute paths to be sure our cycle checks will work"
+ include_path = osp.join(osp.dirname(file_path), include_path)
# end make include path absolute
- include_path = os.path.normpath(include_path)
+ include_path = osp.normpath(include_path)
if include_path in seen or not os.access(include_path, os.R_OK):
continue
seen.add(include_path)