diff options
Diffstat (limited to 'setuptools/sandbox.py')
-rwxr-xr-x | setuptools/sandbox.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 630d5792..b2ae991f 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -155,9 +155,14 @@ class AbstractSandbox: _EXCEPTIONS = [os.devnull,] try: - gen_py = os.path.dirname(__import__('win32com.gen_py', fromlist=['__name__']).__file__) - _EXCEPTIONS.append(gen_py) + win32com_pkg = os.path.dirname(__import__('win32com').__file__) + gen_py_pkg = os.path.join(win32com_pkg, 'gen_py') + _EXCEPTIONS.append(gen_py_pkg) except ImportError: + # it appears pywin32 is not installed, so no need to exclude. + pass +except AttributeError: + # unexpected error getting __file__ from win32com pass class DirectorySandbox(AbstractSandbox): |