diff options
Diffstat (limited to 'setuptools/sandbox.py')
| -rwxr-xr-x | setuptools/sandbox.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index c2f14e7f..a06d4483 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -157,13 +157,13 @@ if hasattr(os, 'devnull'): else: _EXCEPTIONS = [] -if not sys.version < '2.5': - try: - gen_py = os.path.dirname(__import__('win32com.gen_py', - fromlist=['__name__']).__file__) - _EXCEPTIONS.append(gen_py) - except ImportError: - pass +try: + from win32com.client.gencache import GetGeneratePath + _EXCEPTIONS.append(GetGeneratePath()) + del GetGeneratePath +except ImportError: + # it appears pywin32 is not installed, so no need to exclude. + pass class DirectorySandbox(AbstractSandbox): """Restrict operations to a single subdirectory - pseudo-chroot""" |
