From 47a464565e66612086c02d35c470ad20909e3931 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Dec 2013 11:55:44 -0500 Subject: Always return a boolean in DirectorySandbox._ok --HG-- extra : histedit_source : b0072af02db4ba170105a4eb3f8a033dce678869 --- setuptools/sandbox.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'setuptools/sandbox.py') 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 -- cgit v1.2.3