diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2018-03-24 13:45:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-24 13:45:17 +0100 |
commit | f3265bd8beb017890699d093586126ff8af4a3fe (patch) | |
tree | ccf02df66dbb979c7f6da6949456902a06aa1b1e /git/util.py | |
parent | 9f12b26b81a8e7667b2a26a7878e5bc033610ed5 (diff) | |
parent | 80b038f8d8c7c67c148ebd7a5f7a0cb39541b761 (diff) | |
download | gitpython-f3265bd8beb017890699d093586126ff8af4a3fe.tar.gz |
Merge pull request #737 from hugovk/rm-2.6
Drop support for EOL Python 2.6 and 3.3
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/git/util.py b/git/util.py index 52029fed..1186d311 100644 --- a/git/util.py +++ b/git/util.py @@ -14,10 +14,7 @@ import re import shutil import stat import time -try: - from unittest import SkipTest -except ImportError: - from unittest2 import SkipTest +from unittest import SkipTest from gitdb.util import (# NOQA @IgnorePep8 make_sha, @@ -372,7 +369,7 @@ class RemoteProgress(object): re_op_relative = re.compile(r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)") def __init__(self): - self._seen_ops = list() + self._seen_ops = [] self._cur_line = None self.error_lines = [] self.other_lines = [] @@ -395,7 +392,7 @@ class RemoteProgress(object): return [] sub_lines = line.split('\r') - failed_lines = list() + failed_lines = [] for sline in sub_lines: # find escape characters and cut them away - regex will not work with # them as they are non-ascii. As git might expect a tty, it will send them @@ -673,7 +670,7 @@ class Stats(object): """Create a Stat object from output retrieved by git-diff. :return: git.Stat""" - hsh = {'total': {'insertions': 0, 'deletions': 0, 'lines': 0, 'files': 0}, 'files': dict()} + hsh = {'total': {'insertions': 0, 'deletions': 0, 'lines': 0, 'files': 0}, 'files': {}} for line in text.splitlines(): (raw_insertions, raw_deletions, filename) = line.split("\t") insertions = raw_insertions != '-' and int(raw_insertions) or 0 @@ -920,7 +917,7 @@ class Iterable(object): """Defines an interface for iterable items which is to assure a uniform way to retrieve and iterate items within the git repository""" - __slots__ = tuple() + __slots__ = () _id_attribute_ = "attribute that most suitably identifies your instance" @classmethod |