Skip to content

Commit 28e93b5

Browse files
ordereddict and all its reference removed
1 parent 611f4a3 commit 28e93b5

File tree

8 files changed

+8
-160
lines changed

8 files changed

+8
-160
lines changed

examples/twitted/twitted/bin/tophashtags.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
import os
2020

2121
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir)))
22-
try:
23-
from collections import OrderedDict # must be python 2.7
24-
except ImportError:
25-
from splunklib.ordereddict import OrderedDict
22+
from collections import OrderedDict
2623

2724
from splunklib import six
2825
from splunklib.six.moves import zip

splunklib/ordereddict.py

Lines changed: 0 additions & 128 deletions
This file was deleted.

splunklib/results.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
except:
4343
import xml.etree.ElementTree as et
4444

45-
try:
46-
from collections import OrderedDict # must be python 2.7
47-
except ImportError:
48-
from .ordereddict import OrderedDict
45+
from collections import OrderedDict
4946

5047
try:
5148
from splunklib.six.moves import cStringIO as StringIO

splunklib/searchcommands/decorators.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
from __future__ import absolute_import, division, print_function, unicode_literals
1818
from splunklib import six
1919

20-
try:
21-
from collections import OrderedDict # must be python 2.7
22-
except ImportError:
23-
from ..ordereddict import OrderedDict
20+
from collections import OrderedDict # must be python 2.7
2421

2522
from inspect import getmembers, isclass, isfunction
2623
from splunklib.six.moves import map as imap

splunklib/searchcommands/internals.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
from io import TextIOWrapper
2020
from collections import deque, namedtuple
2121
from splunklib import six
22-
try:
23-
from collections import OrderedDict # must be python 2.7
24-
except ImportError:
25-
from ..ordereddict import OrderedDict
22+
from collections import OrderedDict
2623
from splunklib.six.moves import StringIO
2724
from itertools import chain
2825
from splunklib.six.moves import map as imap

splunklib/searchcommands/search_command.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222

2323
import io
2424

25-
try:
26-
from collections import OrderedDict # must be python 2.7
27-
except ImportError:
28-
from ..ordereddict import OrderedDict
25+
from collections import OrderedDict
2926
from copy import deepcopy
3027
from splunklib.six.moves import StringIO
3128
from itertools import chain, islice

tests/searchcommands/test_internals_v2.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
from splunklib.searchcommands import SearchMetric
2222
from splunklib import six
2323
from splunklib.six.moves import range
24-
try:
25-
from collections import OrderedDict # must be python 2.7
26-
except ImportError:
27-
from splunklib.ordereddict import OrderedDict
24+
from collections import OrderedDict
2825
from collections import namedtuple, deque
2926
from splunklib.six import BytesIO as BytesIO
3027
from functools import wraps

tests/test_job.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,7 @@ def test_results_reader(self):
389389
N_results = 0
390390
N_messages = 0
391391
for r in reader:
392-
try:
393-
from collections import OrderedDict
394-
except:
395-
from splunklib.ordereddict import OrderedDict
392+
from collections import OrderedDict
396393
self.assertTrue(isinstance(r, OrderedDict)
397394
or isinstance(r, results.Message))
398395
if isinstance(r, OrderedDict):
@@ -411,10 +408,7 @@ def test_results_reader_with_streaming_results(self):
411408
N_results = 0
412409
N_messages = 0
413410
for r in reader:
414-
try:
415-
from collections import OrderedDict
416-
except:
417-
from splunklib.ordereddict import OrderedDict
411+
from collections import OrderedDict
418412
self.assertTrue(isinstance(r, OrderedDict)
419413
or isinstance(r, results.Message))
420414
if isinstance(r, OrderedDict):

0 commit comments

Comments
 (0)