From 84376ed5bb61c4a8a25048c83ad8d9fa60618db5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 17:09:44 -0400 Subject: Create global import more traditionally. Now the patched functions are available directly as well. --- setuptools/msvc9_support.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'setuptools/msvc9_support.py') 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 -- cgit v1.2.1