diff --git a/.travis.yml b/.travis.yml index 52223bdb9..3c2daf240 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,16 @@ python: - "3.4" - "3.5" - "3.6" - - "3.6-dev" - - "3.7-dev" - - "nightly" # - "pypy" - won't work as smmap doesn't work (see gitdb/.travis.yml for details) matrix: + include: + - python: 3.7 + dist: xenial + sudo: required + - python: "nightly" + dist: xenial + sudo: required allow_failures: - - python: "3.6-dev" - - python: "3.7-dev" - python: "nightly" git: # a higher depth is needed for most of the tests - must be high enough to not actually be shallow diff --git a/README.md b/README.md index 5313f91fb..be7b32d18 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If it is not in your `PATH`, you can help GitPython find it by setting the `GIT_PYTHON_GIT_EXECUTABLE=` environment variable. * Git (1.7.x or newer) -* Python 2.7 to 3.6. +* Python 2.7 to 3.7. The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`. The installer takes care of installing them for you. diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index f37da34aa..446c88fcd 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -1160,7 +1160,7 @@ def iter_items(cls, repo, parent_commit='HEAD'): try: parser = cls._config_parser(repo, pc, read_only=True) except IOError: - raise StopIteration + return # END handle empty iterator rt = pc.tree # root tree diff --git a/git/repo/base.py b/git/repo/base.py index 125ab8021..3c5d68540 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -714,7 +714,10 @@ def blame_incremental(self, rev, file, **kwargs): stream = (line for line in data.split(b'\n') if line) while True: - line = next(stream) # when exhausted, causes a StopIteration, terminating this function + try: + line = next(stream) # when exhausted, causes a StopIteration, terminating this function + except StopIteration: + return hexsha, orig_lineno, lineno, num_lines = line.split() lineno = int(lineno) num_lines = int(num_lines) @@ -724,7 +727,10 @@ def blame_incremental(self, rev, file, **kwargs): # for this commit props = {} while True: - line = next(stream) + try: + line = next(stream) + except StopIteration: + return if line == b'boundary': # "boundary" indicates a root commit and occurs # instead of the "previous" tag @@ -749,7 +755,10 @@ def blame_incremental(self, rev, file, **kwargs): # Discard all lines until we find "filename" which is # guaranteed to be the last line while True: - line = next(stream) # will fail if we reach the EOF unexpectedly + try: + line = next(stream) # will fail if we reach the EOF unexpectedly + except StopIteration: + return tag, value = line.split(b' ', 1) if tag == b'filename': orig_filename = value diff --git a/setup.py b/setup.py index 2703a9cac..cb0300f7b 100755 --- a/setup.py +++ b/setup.py @@ -110,5 +110,6 @@ def _stamp_version(filename): "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", ] ) diff --git a/tox.ini b/tox.ini index ed09c08bf..eb2fe834e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,flake8 +envlist = py27,py34,py35,py36,py37,flake8 [testenv] commands = nosetests {posargs}