Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ordereddict and all its reference removed #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions examples/twitted/twitted/bin/tophashtags.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import os

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir)))
try:
from collections import OrderedDict # must be python 2.7
except ImportError:
from splunklib.ordereddict import OrderedDict
from collections import OrderedDict

from splunklib import six
from splunklib.six.moves import zip
Expand Down
128 changes: 0 additions & 128 deletions splunklib/ordereddict.py

This file was deleted.

5 changes: 1 addition & 4 deletions splunklib/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@
except:
import xml.etree.ElementTree as et

try:
from collections import OrderedDict # must be python 2.7
except ImportError:
from .ordereddict import OrderedDict
from collections import OrderedDict

try:
from splunklib.six.moves import cStringIO as StringIO
Expand Down
5 changes: 1 addition & 4 deletions splunklib/searchcommands/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from splunklib import six

try:
from collections import OrderedDict # must be python 2.7
except ImportError:
from ..ordereddict import OrderedDict
from collections import OrderedDict # must be python 2.7

from inspect import getmembers, isclass, isfunction
from splunklib.six.moves import map as imap
Expand Down
5 changes: 1 addition & 4 deletions splunklib/searchcommands/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
from io import TextIOWrapper
from collections import deque, namedtuple
from splunklib import six
try:
from collections import OrderedDict # must be python 2.7
except ImportError:
from ..ordereddict import OrderedDict
from collections import OrderedDict
from splunklib.six.moves import StringIO
from itertools import chain
from splunklib.six.moves import map as imap
Expand Down
5 changes: 1 addition & 4 deletions splunklib/searchcommands/search_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@

import io

try:
from collections import OrderedDict # must be python 2.7
except ImportError:
from ..ordereddict import OrderedDict
from collections import OrderedDict
from copy import deepcopy
from splunklib.six.moves import StringIO
from itertools import chain, islice
Expand Down
5 changes: 1 addition & 4 deletions tests/searchcommands/test_internals_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
from splunklib.searchcommands import SearchMetric
from splunklib import six
from splunklib.six.moves import range
try:
from collections import OrderedDict # must be python 2.7
except ImportError:
from splunklib.ordereddict import OrderedDict
from collections import OrderedDict
from collections import namedtuple, deque
from splunklib.six import BytesIO as BytesIO
from functools import wraps
Expand Down
10 changes: 2 additions & 8 deletions tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,7 @@ def test_results_reader(self):
N_results = 0
N_messages = 0
for r in reader:
try:
from collections import OrderedDict
except:
from splunklib.ordereddict import OrderedDict
from collections import OrderedDict
self.assertTrue(isinstance(r, OrderedDict)
or isinstance(r, results.Message))
if isinstance(r, OrderedDict):
Expand All @@ -411,10 +408,7 @@ def test_results_reader_with_streaming_results(self):
N_results = 0
N_messages = 0
for r in reader:
try:
from collections import OrderedDict
except:
from splunklib.ordereddict import OrderedDict
from collections import OrderedDict
self.assertTrue(isinstance(r, OrderedDict)
or isinstance(r, results.Message))
if isinstance(r, OrderedDict):
Expand Down