|
38 | 38 | import pandas.compat as compat
|
39 | 39 | from pandas.compat import (
|
40 | 40 | filter, map, zip, range, unichr, lrange, lmap, lzip, u, callable, Counter,
|
41 |
| - raise_with_traceback, httplib, StringIO, PY3) |
| 41 | + raise_with_traceback, httplib, StringIO, string_types, PY3, PY2) |
42 | 42 |
|
43 | 43 | from pandas import (bdate_range, CategoricalIndex, Categorical, IntervalIndex,
|
44 | 44 | DatetimeIndex, TimedeltaIndex, PeriodIndex, RangeIndex,
|
@@ -993,15 +993,15 @@ def raise_assert_detail(obj, message, left, right, diff=None):
|
993 | 993 | elif is_categorical_dtype(left):
|
994 | 994 | left = repr(left)
|
995 | 995 |
|
996 |
| - if compat.PY2 and isinstance(left, compat.string_types): |
| 996 | + if PY2 and isinstance(left, string_types): |
997 | 997 | left = left.encode('utf-8')
|
998 | 998 |
|
999 | 999 | if isinstance(right, np.ndarray):
|
1000 | 1000 | right = pprint_thing(right)
|
1001 | 1001 | elif is_categorical_dtype(right):
|
1002 | 1002 | right = repr(right)
|
1003 | 1003 |
|
1004 |
| - if compat.PY2 and isinstance(right, compat.string_types): |
| 1004 | + if PY2 and isinstance(right, string_types): |
1005 | 1005 | right = right.encode('utf-8')
|
1006 | 1006 |
|
1007 | 1007 | msg = """{obj} are different
|
|
0 commit comments