Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 19.09 36 lines 1.2 kB view raw
1From 542baf59f3b2eada13bde48e8a89e484c2cfeeef Mon Sep 17 00:00:00 2001 2From: Hanaasagi <ambiguous404@gmail.com> 3Date: Wed, 17 Apr 2019 06:46:03 +0000 4Subject: [PATCH] Support Python 3.7 Generator (PEP 479) 5 6--- 7 kernprof.py | 2 ++ 8 line_profiler.py | 2 ++ 9 2 files changed, 4 insertions(+) 10 11diff --git a/kernprof.py b/kernprof.py 12index 108d36e..6461cf6 100755 13--- a/kernprof.py 14+++ b/kernprof.py 15@@ -102,6 +102,8 @@ def wrapper(*args, **kwds): 16 self.enable_by_count() 17 try: 18 item = g.send(input) 19+ except StopIteration: 20+ return 21 finally: 22 self.disable_by_count() 23 input = (yield item) 24diff --git a/line_profiler.py b/line_profiler.py 25index a481dd2..5744d05 100755 26--- a/line_profiler.py 27+++ b/line_profiler.py 28@@ -100,6 +100,8 @@ def wrapper(*args, **kwds): 29 self.enable_by_count() 30 try: 31 item = g.send(input) 32+ except StopIteration: 33+ return 34 finally: 35 self.disable_by_count() 36 input = (yield item)