From bbdcf8c20026e54ca4733b19e9432d178ee8f9d1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 9 Apr 2005 20:07:25 +0000 Subject: [PATCH] Ensure that the results of __str__ and __repr__ are strings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_datetime.i | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wxPython/src/_datetime.i b/wxPython/src/_datetime.i index 4bba1d2124..f0284ce688 100644 --- a/wxPython/src/_datetime.i +++ b/wxPython/src/_datetime.i @@ -860,12 +860,13 @@ public: %pythoncode { def __repr__(self): if self.IsValid(): - return '' % ( self.Format(), self.this) + f = self.Format().encode(wx.GetDefaultPyEncoding()) + return '' % ( f, self.this) else: return '' % self.this def __str__(self): if self.IsValid(): - return self.Format() + return self.Format().encode(wx.GetDefaultPyEncoding()) else: return "INVALID DateTime" } @@ -1011,9 +1012,10 @@ public: %pythoncode { def __repr__(self): - return '' % ( self.Format(), self.this) + f = self.Format().encode(wx.GetDefaultPyEncoding()) + return '' % ( f, self.this) def __str__(self): - return self.Format() + return self.Format().encode(wx.GetDefaultPyEncoding()) } }; -- 2.50.0