about summary refs log tree commit diff
path: root/pkgs/development/python-modules/line_profiler/python37.patch
blob: 0b6e93732c4478bb4e18de645c0feca93509b060 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 542baf59f3b2eada13bde48e8a89e484c2cfeeef Mon Sep 17 00:00:00 2001
From: Hanaasagi <ambiguous404@gmail.com>
Date: Wed, 17 Apr 2019 06:46:03 +0000
Subject: [PATCH] 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 108d36e..6461cf6 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 a481dd2..5744d05 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)