Skip to content

Commit 97445fe

Browse files
committed
remove py2 relics
1 parent bf3045d commit 97445fe

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

intervals/interval.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
from .exc import IllegalArgument, IntervalException, RangeBoundsException
1818
from .parser import IntervalParser, IntervalStringParser
1919

20-
try:
21-
string_types = basestring, # Python 2
22-
except NameError:
23-
string_types = str, # Python 3
24-
2520

2621
def is_number(number):
2722
return isinstance(number, (float, int, Decimal))
@@ -171,7 +166,7 @@ def __init__(
171166
30
172167
173168
"""
174-
if isinstance(bounds, string_types):
169+
if isinstance(bounds, str):
175170
raise TypeError(
176171
'First argument should be a list or tuple. If you wish to '
177172
'initialize an interval from string, use from_string factory '
@@ -301,7 +296,7 @@ def coerce_value(self, value):
301296
return value
302297
elif isinstance(value, self.type):
303298
return value
304-
elif isinstance(value, string_types):
299+
elif isinstance(value, str):
305300
return self.coerce_string(value)
306301
else:
307302
return self.coerce_obj(value)

intervals/parser.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
from .exc import IntervalException
22

3-
try:
4-
string_types = basestring, # Python 2
5-
except NameError:
6-
string_types = str, # Python 3
7-
8-
93
strip = lambda a: a.strip()
104

115

0 commit comments

Comments
 (0)