diff --git a/.travis.yml b/.travis.yml index 67a34a07..b5f618bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,17 @@ +dist: xenial language: python python: - "nightly" - - "3.7-dev" - - "3.6-dev" + - "3.8-dev" + - "3.7" - "3.6" - "3.5" - - "3.4" - - "3.3" - "2.7" matrix: fast_finish: true allow_failures: - python: "nightly" - - python: "3.7-dev" - - python: "3.6-dev" + - python: "3.8-dev" install: - pip install --install-option='--no-cython-compile' Cython - pip install -r dev_requirements.txt diff --git a/kernprof.py b/kernprof.py index 108d36e8..74280308 100755 --- a/kernprof.py +++ b/kernprof.py @@ -94,6 +94,8 @@ def wrapper(*args, **kwds): self.enable_by_count() try: item = next(g) + except StopIteration: + return finally: self.disable_by_count() input = (yield item) @@ -102,6 +104,8 @@ def wrapper(*args, **kwds): self.enable_by_count() try: item = g.send(input) + except StopIteration: + return finally: self.disable_by_count() input = (yield item) diff --git a/line_profiler.py b/line_profiler.py index a481dd25..b5772112 100755 --- a/line_profiler.py +++ b/line_profiler.py @@ -92,6 +92,8 @@ def wrapper(*args, **kwds): self.enable_by_count() try: item = next(g) + except StopIteration: + return finally: self.disable_by_count() input = (yield item) @@ -100,6 +102,8 @@ def wrapper(*args, **kwds): self.enable_by_count() try: item = g.send(input) + except StopIteration: + return finally: self.disable_by_count() input = (yield item)