Skip to content

Commit 452913a

Browse files
committed
Remove Python 2-specific imports
Change-Id: I64810898cd9126cf619df0b8f60e6fa01958943e Signed-off-by: Stephen Finucane <[email protected]>
1 parent 0396bba commit 452913a

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

nova/scheduler/host_manager.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
import collections
2121
import functools
2222
import time
23-
try:
24-
from collections import UserDict as IterableUserDict # Python 3
25-
except ImportError:
26-
from UserDict import IterableUserDict # Python 2
27-
2823

2924
import iso8601
3025
from oslo_log import log as logging
@@ -47,7 +42,7 @@
4742
HOST_INSTANCE_SEMAPHORE = "host_instance"
4843

4944

50-
class ReadOnlyDict(IterableUserDict):
45+
class ReadOnlyDict(collections.UserDict):
5146
"""A read-only dict."""
5247

5348
def __init__(self, source=None):

nova/tests/unit/test_metadata.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@
2020
import hashlib
2121
import hmac
2222
import os
23+
import pickle
2324
import re
2425

25-
try: # python 2
26-
import pickle
27-
except ImportError: # python 3
28-
import cPickle as pickle
29-
3026
from keystoneauth1 import exceptions as ks_exceptions
3127
from keystoneauth1 import session
3228
import mock

0 commit comments

Comments
 (0)