Skip to content

Commit

Permalink
Merge pull request #1003 from fvisin/fix_recursion_limit
Browse files Browse the repository at this point in the history
Fix Blocks ignores python's recursionlimit setting
  • Loading branch information
dmitriy-serdyuk committed Feb 24, 2016
2 parents 84f1b6d + eb1e242 commit 5107756
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ def print_shape(x, header=None):
def change_recursion_limit(limit):
"""Temporarily changes the recursion limit."""
old_limit = sys.getrecursionlimit()
sys.setrecursionlimit(limit)
if old_limit < limit:
sys.setrecursionlimit(limit)
yield
sys.setrecursionlimit(old_limit)

Expand Down

0 comments on commit 5107756

Please sign in to comment.