Description: Fix FTBFS against Python 3.7
Author: Matthias Klose <doko@ubuntu.com>
Bug-Debian: https://bugs.debian.org/904655
Applied-Upstream: 3.0.2, https://github.com/pyutils/line_profiler/commit/8fe91f539e0e096028202c6701203d074c309cf0
Reviewed-by: Sébastien Villemot <sebastien@debian.org>
Last-Update: 2018-11-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- python-line-profiler-2.1.orig/kernprof.py
+++ python-line-profiler-2.1/kernprof.py
@@ -102,6 +102,8 @@ class ContextualProfile(Profile):
                 self.enable_by_count()
                 try:
                     item = g.send(input)
+                except StopIteration:
+                    return
                 finally:
                     self.disable_by_count()
                 input = (yield item)
--- python-line-profiler-2.1.orig/line_profiler.py
+++ python-line-profiler-2.1/line_profiler.py
@@ -100,6 +100,8 @@ class LineProfiler(CLineProfiler):
                 self.enable_by_count()
                 try:
                     item = g.send(input)
+                except StopIteration:
+                    return
                 finally:
                     self.disable_by_count()
                 input = (yield item)
