diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-12-07 11:55:44 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-12-07 11:55:44 -0500 |
commit | 47a464565e66612086c02d35c470ad20909e3931 (patch) | |
tree | 4fd495fa3e5646e3ee2987a27ba5638c362de37b /setuptools/sandbox.py | |
parent | 7a8e4a536be8c6cc8f313e6f0e6b907ffc55b205 (diff) | |
download | external_python_setuptools-47a464565e66612086c02d35c470ad20909e3931.tar.gz external_python_setuptools-47a464565e66612086c02d35c470ad20909e3931.tar.bz2 external_python_setuptools-47a464565e66612086c02d35c470ad20909e3931.zip |
Always return a boolean in DirectorySandbox._ok
--HG--
extra : histedit_source : b0072af02db4ba170105a4eb3f8a033dce678869
Diffstat (limited to 'setuptools/sandbox.py')
-rwxr-xr-x | setuptools/sandbox.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 7354e46a..49c4ea93 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -200,7 +200,10 @@ class DirectorySandbox(AbstractSandbox): def __init__(self, sandbox, exceptions=_EXCEPTIONS): self._sandbox = os.path.normcase(os.path.realpath(sandbox)) self._prefix = os.path.join(self._sandbox,'') - self._exceptions = [os.path.normcase(os.path.realpath(path)) for path in exceptions] + self._exceptions = [ + os.path.normcase(os.path.realpath(path)) + for path in exceptions + ] AbstractSandbox.__init__(self) def _violation(self, operation, *args, **kw): @@ -225,9 +228,11 @@ class DirectorySandbox(AbstractSandbox): try: self._active = False realpath = os.path.normcase(os.path.realpath(path)) - if (self._exempted(realpath) or realpath == self._sandbox - or realpath.startswith(self._prefix)): - return True + return ( + self._exempted(realpath) + or realpath == self._sandbox + or realpath.startswith(self._prefix) + ) finally: self._active = active |