From 9e4c74f2388421efa683694fa52062b1554e2c91 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sun, 11 Mar 2018 00:22:19 -0600
Subject: [PATCH] MinRecursionLimit: do not actually reset recursion limit down
 to lower value

---
 pytools/__init__.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/pytools/__init__.py b/pytools/__init__.py
index 70eb530..f831c3e 100644
--- a/pytools/__init__.py
+++ b/pytools/__init__.py
@@ -1943,15 +1943,13 @@ class MinRecursionLimit(object):
         # (or long chains of to-be gc'd generators) that cannot be
         # undergo garbage collection with a lower recursion limit.
         #
-        # Force a garbage collection while the recursion limit is
-        # still high to avoid this situation.
+        # As a result, it doesn't seem possible to lower the recursion limit
+        # again after it has been raised without causing reliability issues.
         #
         # See https://gitlab.tiker.net/inducer/sumpy/issues/31 for
         # context.
-        import gc
-        gc.collect()
 
-        sys.setrecursionlimit(self.prev_recursion_limit)
+        pass
 
 # }}}
 
-- 
GitLab