From b5b0b78fc7c2add5ee5211f504ee79c5ae15f162 Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Fri, 22 Nov 2013 12:23:58 -0800 Subject: [PATCH] Remove obsolete future imports The with statement has been standard since Python 2.5, so we can get rid of these imports. Change-Id: I280971c3d8c01e94cc2c17cacaedcbe9d9c8a3c3 --- swift/account/backend.py | 1 - swift/account/server.py | 2 -- swift/common/db.py | 1 - swift/common/db_replicator.py | 1 - swift/common/manager.py | 1 - swift/container/backend.py | 1 - swift/container/server.py | 2 -- swift/obj/diskfile.py | 1 - swift/obj/mem_diskfile.py | 1 - swift/obj/mem_server.py | 1 - swift/obj/server.py | 1 - swift/obj/ssync_receiver.py | 2 -- swift/obj/ssync_sender.py | 2 -- test/unit/account/test_backend.py | 1 - test/unit/common/test_db.py | 1 - test/unit/common/test_memcached.py | 1 - test/unit/common/test_utils.py | 1 - test/unit/common/test_wsgi.py | 1 - test/unit/container/test_backend.py | 1 - test/unit/obj/test_diskfile.py | 2 -- test/unit/obj/test_replicator.py | 2 -- test/unit/proxy/test_server.py | 1 - 22 files changed, 28 deletions(-) diff --git a/swift/account/backend.py b/swift/account/backend.py index 96c7556b9b..5de41ef2b7 100644 --- a/swift/account/backend.py +++ b/swift/account/backend.py @@ -16,7 +16,6 @@ Pluggable Back-end for Account Server """ -from __future__ import with_statement import os from uuid import uuid4 import time diff --git a/swift/account/server.py b/swift/account/server.py index 7a41564fca..d467bf7c76 100644 --- a/swift/account/server.py +++ b/swift/account/server.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement - import os import time import traceback diff --git a/swift/common/db.py b/swift/common/db.py index 4da7aed3d7..aa7c3af161 100644 --- a/swift/common/db.py +++ b/swift/common/db.py @@ -15,7 +15,6 @@ """ Database code for Swift """ -from __future__ import with_statement from contextlib import contextmanager, closing import hashlib import logging diff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py index a8e3930240..7b1e4ac062 100644 --- a/swift/common/db_replicator.py +++ b/swift/common/db_replicator.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import os import random import math diff --git a/swift/common/manager.py b/swift/common/manager.py index a157d2ca12..900a5419a0 100644 --- a/swift/common/manager.py +++ b/swift/common/manager.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import functools import errno import os diff --git a/swift/container/backend.py b/swift/container/backend.py index a2b36fbb0e..04ae9bcb67 100644 --- a/swift/container/backend.py +++ b/swift/container/backend.py @@ -16,7 +16,6 @@ Pluggable Back-ends for Container Server """ -from __future__ import with_statement import os from uuid import uuid4 import time diff --git a/swift/container/server.py b/swift/container/server.py index 3f85544350..a189d02490 100644 --- a/swift/container/server.py +++ b/swift/container/server.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement - import os import time import traceback diff --git a/swift/obj/diskfile.py b/swift/obj/diskfile.py index 09c7d2f529..6daf6e2158 100644 --- a/swift/obj/diskfile.py +++ b/swift/obj/diskfile.py @@ -30,7 +30,6 @@ The remaining methods in this module are considered implementation specifc and are also not considered part of the backend API. """ -from __future__ import with_statement import cPickle as pickle import errno import os diff --git a/swift/obj/mem_diskfile.py b/swift/obj/mem_diskfile.py index d29ed625da..da206dea72 100644 --- a/swift/obj/mem_diskfile.py +++ b/swift/obj/mem_diskfile.py @@ -15,7 +15,6 @@ """ In-Memory Disk File Interface for Swift Object Server""" -from __future__ import with_statement import cStringIO import time import hashlib diff --git a/swift/obj/mem_server.py b/swift/obj/mem_server.py index a1f985ebc3..aa61a18ef0 100644 --- a/swift/obj/mem_server.py +++ b/swift/obj/mem_server.py @@ -15,7 +15,6 @@ """ In-Memory Object Server for Swift """ -from __future__ import with_statement import os from swift import gettext_ as _ diff --git a/swift/obj/server.py b/swift/obj/server.py index 293909704c..60ddb4e742 100644 --- a/swift/obj/server.py +++ b/swift/obj/server.py @@ -15,7 +15,6 @@ """ Object Server for Swift """ -from __future__ import with_statement import cPickle as pickle import os import multiprocessing diff --git a/swift/obj/ssync_receiver.py b/swift/obj/ssync_receiver.py index 88b555188a..dab008d55d 100644 --- a/swift/obj/ssync_receiver.py +++ b/swift/obj/ssync_receiver.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement - import urllib import eventlet diff --git a/swift/obj/ssync_sender.py b/swift/obj/ssync_sender.py index b90c039ff0..8e422bada1 100644 --- a/swift/obj/ssync_sender.py +++ b/swift/obj/ssync_sender.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement - import urllib import eventlet diff --git a/test/unit/account/test_backend.py b/test/unit/account/test_backend.py index 4decfbde5f..0a46cb63ac 100644 --- a/test/unit/account/test_backend.py +++ b/test/unit/account/test_backend.py @@ -15,7 +15,6 @@ """ Tests for swift.account.backend """ -from __future__ import with_statement import hashlib import unittest from time import sleep, time diff --git a/test/unit/common/test_db.py b/test/unit/common/test_db.py index 90c4761f68..8952ec4253 100644 --- a/test/unit/common/test_db.py +++ b/test/unit/common/test_db.py @@ -15,7 +15,6 @@ """Tests for swift.common.db""" -from __future__ import with_statement import os import unittest from shutil import rmtree, copy diff --git a/test/unit/common/test_memcached.py b/test/unit/common/test_memcached.py index f29c6db818..60227351bb 100644 --- a/test/unit/common/test_memcached.py +++ b/test/unit/common/test_memcached.py @@ -16,7 +16,6 @@ """Tests for swift.common.utils""" -from __future__ import with_statement from collections import defaultdict import logging import socket diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py index 2595597a6f..710c5a9b22 100644 --- a/test/unit/common/test_utils.py +++ b/test/unit/common/test_utils.py @@ -15,7 +15,6 @@ """Tests for swift.common.utils""" -from __future__ import with_statement from test.unit import temptree import ctypes diff --git a/test/unit/common/test_wsgi.py b/test/unit/common/test_wsgi.py index 0debe195d2..085364c267 100644 --- a/test/unit/common/test_wsgi.py +++ b/test/unit/common/test_wsgi.py @@ -15,7 +15,6 @@ """Tests for swift.common.wsgi""" -from __future__ import with_statement import errno import logging import mimetools diff --git a/test/unit/container/test_backend.py b/test/unit/container/test_backend.py index ccc0b250f1..31dd30d819 100644 --- a/test/unit/container/test_backend.py +++ b/test/unit/container/test_backend.py @@ -15,7 +15,6 @@ """ Tests for swift.container.backend """ -from __future__ import with_statement import hashlib import unittest from time import sleep, time diff --git a/test/unit/obj/test_diskfile.py b/test/unit/obj/test_diskfile.py index cf99530b58..fb4e28164d 100644 --- a/test/unit/obj/test_diskfile.py +++ b/test/unit/obj/test_diskfile.py @@ -16,8 +16,6 @@ """Tests for swift.obj.diskfile""" -from __future__ import with_statement - import cPickle as pickle import os import errno diff --git a/test/unit/obj/test_replicator.py b/test/unit/obj/test_replicator.py index 46d90f6678..e0a6974e1e 100644 --- a/test/unit/obj/test_replicator.py +++ b/test/unit/obj/test_replicator.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement - import unittest import os import mock diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index 72a813cf92..4c746f4b6f 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import cPickle as pickle import logging import os