summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test__datasource.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-06 07:42:08 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-04-06 07:42:08 -0700
commit49a8902a673d6fb2ba9ca446fc652aa9d2e55e1b (patch)
treee71c0d8f6123307860a58796ed840bf32526b3fe /numpy/lib/tests/test__datasource.py
parent3c8fc14665548c71a9cd144b2e16d9309a92e255 (diff)
parent4394515cd5632a7f110993ff75033d407d10861d (diff)
downloadnumpy-49a8902a673d6fb2ba9ca446fc652aa9d2e55e1b.tar.gz
Merge pull request #3191 from charris/2to3-apply-imports-fixer
2to3: Apply `imports` fixer.
Diffstat (limited to 'numpy/lib/tests/test__datasource.py')
-rw-r--r--numpy/lib/tests/test__datasource.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py
index e784e4296..ccd7405fe 100644
--- a/numpy/lib/tests/test__datasource.py
+++ b/numpy/lib/tests/test__datasource.py
@@ -1,17 +1,20 @@
from __future__ import division, absolute_import
import os
+import urllib2
+import sys
+import numpy.lib._datasource as datasource
from tempfile import mkdtemp, mkstemp, NamedTemporaryFile
from shutil import rmtree
-from urlparse import urlparse
from urllib2 import URLError
-import urllib2
-
+from numpy.compat import asbytes
from numpy.testing import *
-from numpy.compat import asbytes
-import numpy.lib._datasource as datasource
+if sys.version_info[0] >= 3:
+ from urllib.parse import urlparse
+else:
+ from urlparse import urlparse
def urlopen_stub(url, data=None):
'''Stub to replace urlopen for testing.'''