summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test__datasource.py
diff options
context:
space:
mode:
authorRobert Kern <robert.kern@gmail.com>2008-07-03 06:15:14 +0000
committerRobert Kern <robert.kern@gmail.com>2008-07-03 06:15:14 +0000
commit102cdc22b12df8a44be644d39a277229e5324028 (patch)
tree104f86c4355fd18c9bd7d7648b120a0d0c288299 /numpy/lib/tests/test__datasource.py
parent590babe4646a3435f8a709d6230d05c10f085be1 (diff)
downloadnumpy-102cdc22b12df8a44be644d39a277229e5324028.tar.gz
Reduce numpy's import times by delaying a few time consuming imports to the point of actual use and global instantiations of finfo. Thanks to David Cournapeau for tracking down and fixing the import part of the problem.
Diffstat (limited to 'numpy/lib/tests/test__datasource.py')
-rw-r--r--numpy/lib/tests/test__datasource.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py
index abb58701d..5102237d6 100644
--- a/numpy/lib/tests/test__datasource.py
+++ b/numpy/lib/tests/test__datasource.py
@@ -5,6 +5,7 @@ import struct
from tempfile import mkdtemp, mkstemp, NamedTemporaryFile
from shutil import rmtree
from urlparse import urlparse
+from urllib2 import URLError
from numpy.testing import *
@@ -16,7 +17,7 @@ def urlopen_stub(url, data=None):
tmpfile = NamedTemporaryFile(prefix='urltmp_')
return tmpfile
else:
- raise datasource.URLError('Name or service not known')
+ raise URLError('Name or service not known')
# Rebind urlopen during testing. For a 'real' test, uncomment the rebinding
# below.