From f9f792eb04dfd48d93682070583f473166b490ae Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 5 Sep 2013 14:38:59 -0500 Subject: [1.6.x] Took advantage of django.utils.six.moves.urllib.*. Backport of 6a6428a36 from master. --- tests/servers/tests.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/servers') diff --git a/tests/servers/tests.py b/tests/servers/tests.py index be74afe820..caa2ddb084 100644 --- a/tests/servers/tests.py +++ b/tests/servers/tests.py @@ -5,16 +5,14 @@ Tests for django.core.servers. from __future__ import unicode_literals import os -try: - from urllib.request import urlopen, HTTPError -except ImportError: # Python 2 - from urllib2 import urlopen, HTTPError from django.core.exceptions import ImproperlyConfigured from django.test import LiveServerTestCase from django.core.servers.basehttp import WSGIServerException from django.test.utils import override_settings from django.utils.http import urlencode +from django.utils.six.moves.urllib.error import HTTPError +from django.utils.six.moves.urllib.request import urlopen from django.utils._os import upath from .models import Person -- cgit v1.3