From 542baf59f3b2eada13bde48e8a89e484c2cfeeef Mon Sep 17 00:00:00 2001 From: Hanaasagi Date: Wed, 17 Apr 2019 06:46:03 +0000 Subject: [PATCH 1/3] Support Python 3.7 Generator (PEP 479) --- kernprof.py | 2 ++ line_profiler.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/kernprof.py b/kernprof.py index 108d36e8..6461cf65 100755 --- a/kernprof.py +++ b/kernprof.py @@ -102,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) diff --git a/line_profiler.py b/line_profiler.py index a481dd25..5744d056 100755 --- a/line_profiler.py +++ b/line_profiler.py @@ -100,6 +100,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) From 8b6bebc0c00fee2d69a9961e8c9322e73bfbbccb Mon Sep 17 00:00:00 2001 From: Hanaasagi Date: Sat, 13 Jul 2019 10:44:37 +0900 Subject: [PATCH 2/3] update travis config --- .travis.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 From 8fe91f539e0e096028202c6701203d074c309cf0 Mon Sep 17 00:00:00 2001 From: Hanaasagi Date: Mon, 29 Jul 2019 13:16:05 +0900 Subject: [PATCH 3/3] Also handle StopIteration in first iterate --- kernprof.py | 2 ++ line_profiler.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/kernprof.py b/kernprof.py index 6461cf65..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) diff --git a/line_profiler.py b/line_profiler.py index 5744d056..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)