summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')