diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-09-26 17:09:44 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-09-26 17:09:44 -0400 |
commit | e07024b052d49b693bece8550309ddb0aca08c9a (patch) | |
tree | 359428d34e0135d60abaec797529fa1843c6abed | |
parent | e541a797f929eb090d53c5138b0498a9001a15ee (diff) | |
download | python-setuptools-bitbucket-e07024b052d49b693bece8550309ddb0aca08c9a.tar.gz |
Create global import more traditionally. Now the patched functions are available directly as well.
-rw-r--r-- | setuptools/msvc9_support.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py index 61ca8579..d0be70e2 100644 --- a/setuptools/msvc9_support.py +++ b/setuptools/msvc9_support.py @@ -1,6 +1,10 @@ import sys -distutils = None +try: + import distutils.msvc9compiler +except ImportError: + pass + unpatched = dict() def patch_for_specialized_compiler(): @@ -9,10 +13,7 @@ def patch_for_specialized_compiler(): build for Python (Windows only). Fall back to original behavior when the standalone compiler is not available. """ - global distutils - try: - distutils = __import__('distutils.msvc9compiler') - except ImportError: + if 'distutils' not in globals(): # The module isn't available to be patched return |