From 1ad053872a44469c1e57cdc07e45e82ff85d2456 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 17 Sep 2003 20:21:28 +0000 Subject: [PATCH] Unicode fix from Will git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/lib/timectrl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wxPython/wxPython/lib/timectrl.py b/wxPython/wxPython/lib/timectrl.py index 7347a2799a..058b287e9c 100644 --- a/wxPython/wxPython/lib/timectrl.py +++ b/wxPython/wxPython/lib/timectrl.py @@ -517,6 +517,9 @@ class wxTimeCtrl(wxMaskedTextCtrl): value = self.GetValue() dbg('value = "%s"' % value) + if type(value) == types.UnicodeType: + value = str(value) # convert to regular string + valid = True # assume true if type(value) == types.StringType: @@ -547,7 +550,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): hour, minute, second = value.hour, value.minute, value.second else: # Not a valid function argument - if self.__accept_mx: + if accept_mx: error = 'GetWxDateTime requires wxDateTime, mxDateTime or parsable time string, passed %s'% repr(value) else: error = 'GetWxDateTime requires wxDateTime or parsable time string, passed %s'% repr(value)