aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_sandbox.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-13 10:05:24 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-13 10:05:24 -0500
commita627cf9a72f8fca78b0520b72a5b44a0bbea9b8c (patch)
tree11ae547bf3cffad8c939df35622ffcae4fae8629 /setuptools/tests/test_sandbox.py
parent7fd5df90d1f251a22bdb74bed21cebf298b6a8e8 (diff)
downloadexternal_python_setuptools-a627cf9a72f8fca78b0520b72a5b44a0bbea9b8c.tar.gz
external_python_setuptools-a627cf9a72f8fca78b0520b72a5b44a0bbea9b8c.tar.bz2
external_python_setuptools-a627cf9a72f8fca78b0520b72a5b44a0bbea9b8c.zip
Add test capturing infinite recursion. Ref #440.
Diffstat (limited to 'setuptools/tests/test_sandbox.py')
-rw-r--r--setuptools/tests/test_sandbox.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py
index 6e1e9e1c..624954df 100644
--- a/setuptools/tests/test_sandbox.py
+++ b/setuptools/tests/test_sandbox.py
@@ -100,3 +100,13 @@ class TestExceptionSaver:
saved_exc.resume()
assert str(caught.value) == "CantPickleThis('detail',)"
+
+ def test_unpickleable_exception_when_hiding_setuptools(self):
+ """
+ As revealed in #440, an infinite recursion can occur if an unpickleable
+ exception while setuptools is hidden. Ensure this doesn't happen.
+ """
+ sandbox = setuptools.sandbox
+ with sandbox.save_modules():
+ sandbox.hide_setuptools()
+ raise sandbox.SandboxViolation('test')