Skip to content

Commit 7ef56a4

Browse files
a-detistemichaelmior
authored andcommitted
remove Python2 crumbs
1 parent 83ccb92 commit 7ef56a4

File tree

9 files changed

+6
-28
lines changed

9 files changed

+6
-28
lines changed

jsonpath_ng/bin/jsonpath.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
# terms of the Do What The Fuck You Want To Public License, Version 2,
66
# as published by Sam Hocevar. See the COPYING file for more details.
77

8-
# Use modern Python
9-
from __future__ import unicode_literals, print_function, absolute_import
10-
118
# Standard Library imports
129
import json
1310
import sys

jsonpath_ng/jsonpath.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import (absolute_import, division, generators, nested_scopes,
2-
print_function, unicode_literals)
3-
41
import logging
52
from itertools import * # noqa
63
from jsonpath_ng.lexer import JsonPathLexer
@@ -16,7 +13,7 @@
1613
LIST_KEY = object()
1714

1815

19-
class JSONPath(object):
16+
class JSONPath:
2017
"""
2118
The base class for JSONPath abstract syntax; those
2219
methods stubbed here are the interface to supported
@@ -78,7 +75,7 @@ def make_datum(self, value):
7875
return DatumInContext(value, path=Root(), context=None)
7976

8077

81-
class DatumInContext(object):
78+
class DatumInContext:
8279
"""
8380
Represents a datum along a path from a context.
8481

jsonpath_ng/lexer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
21
import sys
32
import logging
43

@@ -9,7 +8,7 @@
98
logger = logging.getLogger(__name__)
109

1110

12-
class JsonPathLexer(object):
11+
class JsonPathLexer:
1312
'''
1413
A Lexical analyzer for JsonPath.
1514
'''

jsonpath_ng/parser.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
from __future__ import (
2-
print_function,
3-
absolute_import,
4-
division,
5-
generators,
6-
nested_scopes,
7-
)
81
import logging
92
import sys
103
import os.path
@@ -22,7 +15,7 @@ def parse(string):
2215
return JsonPathParser().parse(string)
2316

2417

25-
class JsonPathParser(object):
18+
class JsonPathParser:
2619
'''
2720
An LALR-parser for JsonPath
2821
'''
@@ -189,7 +182,7 @@ def p_empty(self, p):
189182
'empty :'
190183
p[0] = None
191184

192-
class IteratorToTokenStream(object):
185+
class IteratorToTokenStream:
193186
def __init__(self, iterator):
194187
self.iterator = iterator
195188

tests/bin/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
# Use modern python
2-
from __future__ import absolute_import, print_function, unicode_literals

tests/bin/test_jsonpath.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Use modern Python
2-
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
3-
41
# Standard library imports
52
import unittest
63
import logging
@@ -15,7 +12,7 @@ class TestJsonPathScript(unittest.TestCase):
1512
"""
1613
Tests for the jsonpath.py command line interface.
1714
"""
18-
15+
1916
@classmethod
2017
def setup_class(cls):
2118
logging.basicConfig()

tests/test_jsonpath.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
21
import unittest
32

43
from jsonpath_ng import jsonpath # For setting the global auto_id_field flag

tests/test_lexer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
21
import logging
32
import unittest
43

tests/test_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
21
import unittest
32

43
from jsonpath_ng.lexer import JsonPathLexer

0 commit comments

Comments
 (0)