summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-12-03 15:53:50 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-12-03 15:53:50 +0000
commitccdfafcf58fdf3dc1d95acc090445e56267bd4ab (patch)
treef68ed81ac470ca2467fdc775e5a3b86f5a681086
parent2b517694e894ac6853f85899e5603758caf13c68 (diff)
downloadnumpy-ccdfafcf58fdf3dc1d95acc090445e56267bd4ab.tar.gz
Fix relative import in top numpy.distutils.
-rw-r--r--numpy/distutils/__init__.py40
1 files changed, 28 insertions, 12 deletions
diff --git a/numpy/distutils/__init__.py b/numpy/distutils/__init__.py
index 4ed08d7f6..cdc5d45b6 100644
--- a/numpy/distutils/__init__.py
+++ b/numpy/distutils/__init__.py
@@ -1,19 +1,35 @@
+import sys
-from __version__ import version as __version__
+if sys.version_info[0] < 3:
+ from __version__ import version as __version__
+ # Must import local ccompiler ASAP in order to get
+ # customized CCompiler.spawn effective.
+ import ccompiler
+ import unixccompiler
-# Must import local ccompiler ASAP in order to get
-# customized CCompiler.spawn effective.
-import ccompiler
-import unixccompiler
+ from info import __doc__
+ from npy_pkg_config import *
-from info import __doc__
-from npy_pkg_config import *
+ try:
+ import __config__
+ _INSTALLED = True
+ except ImportError:
+ _INSTALLED = False
+else:
+ from numpy.distutils.__version__ import version as __version__
+ # Must import local ccompiler ASAP in order to get
+ # customized CCompiler.spawn effective.
+ import numpy.distutils.ccompiler
+ import numpy.distutils.unixccompiler
-try:
- import __config__
- _INSTALLED = True
-except ImportError:
- _INSTALLED = False
+ from numpy.distutils.info import __doc__
+ from numpy.distutils.npy_pkg_config import *
+
+ try:
+ import numpy.distutils.__config__
+ _INSTALLED = True
+ except ImportError:
+ _INSTALLED = False
if _INSTALLED:
from numpy.testing import Tester