aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-13 10:48:20 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-13 10:48:20 -0500
commit264b5dc6b9cf48b22bd2263d426026d7b8f45608 (patch)
tree48ebb0902442b5154ee24059e0410c8f7bbe7c37 /setuptools
parentbf8331685d1d5bb88cc6cf09236601f0dbe62330 (diff)
downloadexternal_python_setuptools-264b5dc6b9cf48b22bd2263d426026d7b8f45608.tar.gz
external_python_setuptools-264b5dc6b9cf48b22bd2263d426026d7b8f45608.tar.bz2
external_python_setuptools-264b5dc6b9cf48b22bd2263d426026d7b8f45608.zip
Prevent infinite recursion when UnpickleableException occurs in a sandbox context. Fixes #440.
Diffstat (limited to 'setuptools')
-rwxr-xr-xsetuptools/sandbox.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py
index 213cebff..b8b1bac1 100755
--- a/setuptools/sandbox.py
+++ b/setuptools/sandbox.py
@@ -98,8 +98,8 @@ class UnpickleableException(Exception):
"""
An exception representing another Exception that could not be pickled.
"""
- @classmethod
- def dump(cls, type, exc):
+ @staticmethod
+ def dump(type, exc):
"""
Always return a dumped (pickled) type and exc. If exc can't be pickled,
wrap it in UnpickleableException first.
@@ -107,6 +107,8 @@ class UnpickleableException(Exception):
try:
return pickle.dumps(type), pickle.dumps(exc)
except Exception:
+ # get UnpickleableException inside the sandbox
+ from setuptools.sandbox import UnpickleableException as cls
return cls.dump(cls, cls(repr(exc)))