Skip to content

Commit 2cfabee

Browse files
committed
BUG: fix unicode -> str cast in tslib
This should use format since calling str on a unicode string is a *bad* idea because it may or may not repr correctly.
1 parent 5c3ca01 commit 2cfabee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tslib.pyx

+2-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,8 @@ cdef class _Timestamp(datetime):
465465
elif op == 3:
466466
return True
467467
else:
468-
raise TypeError('Cannot compare Timestamp with %s' % str(other))
468+
raise TypeError('Cannot compare Timestamp with '
469+
'{0!r}'.format(other.__class__.__name__))
469470

470471
self._assert_tzawareness_compat(other)
471472

0 commit comments

Comments
 (0)