X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d4b73b1b8e585418459362c9bf9173aa21da8c41..f50de1504e002ba3afac3491c8b4817870c850d8:/wxPython/wx/tools/dbg.py?ds=sidebyside diff --git a/wxPython/wx/tools/dbg.py b/wxPython/wx/tools/dbg.py index 5c791f8864..cda8d5fe2f 100644 --- a/wxPython/wx/tools/dbg.py +++ b/wxPython/wx/tools/dbg.py @@ -147,8 +147,14 @@ class Logger: return if self._dbg and len(args) and not self._suspend: - # (emulate print functionality) - strs = [str(arg) for arg in args] + # (emulate print functionality; handle unicode as best as possible:) + strs = [] + for arg in args: + try: + strs.append(str(arg)) + except: + strs.append(repr(arg)) + output = ' '.join(strs) if self.name: output = self.name+': ' + output output = ' ' * 3 * self._indent + output