From 799862d4c83c558ba6ebb5b5b67c73defe983dbc Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Thu, 7 Jan 2010 00:00:57 +0000 Subject: [PATCH] FIX: Problem Windows XP 64bits error: wx._core.PyAssertionError --- invesalius/gui/dialogs.py | 19 +++++++++++-------- invesalius/invesalius.py | 16 +++++++++++----- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index 81366a4..3cc372b 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -167,14 +167,17 @@ def ShowImportDirDialog(): | wx.DD_CHANGE_DIR) path = None - if dlg.ShowModal() == wx.ID_OK: - # GetPath returns in unicode, if a path has non-ascii characters a - # UnicodeEncodeError is raised. To avoid this, path is encoded in utf-8 - if sys.platform == "win32": - path = dlg.GetPath() - else: - path = dlg.GetPath().encode('utf-8') - + try: + if dlg.ShowModal() == wx.ID_OK: + # GetPath returns in unicode, if a path has non-ascii characters a + # UnicodeEncodeError is raised. To avoid this, path is encoded in utf-8 + if sys.platform == "win32": + path = dlg.GetPath() + else: + path = dlg.GetPath().encode('utf-8') + except(wx._core.PyAssertionError): #TODO: error win64 + path = dlg.GetPath() + # Only destroy a dialog after you're done with it. dlg.Destroy() os.chdir(current_dir) diff --git a/invesalius/invesalius.py b/invesalius/invesalius.py index bc12b8d..077dd2f 100755 --- a/invesalius/invesalius.py +++ b/invesalius/invesalius.py @@ -55,11 +55,17 @@ class SplashScreen(wx.SplashScreen): if not(lang): ldlg = lang_dlg.LanguageDialog() - - if (ldlg.ShowModal() == wx.ID_OK): - lang = ldlg.GetSelectedLanguage() - session.SetLanguage(lang) - _ = i18n.InstallLanguage(lang) + + try: + if (ldlg.ShowModal() == wx.ID_OK): + lang = ldlg.GetSelectedLanguage() + session.SetLanguage(lang) + _ = i18n.InstallLanguage(lang) + except(wx._core.PyAssertionError): #TODO: error win64 + lang = ldlg.GetSelectedLanguage() + session.SetLanguage(lang) + _ = i18n.InstallLanguage(lang) + else: _ = i18n.InstallLanguage(lang) -- libgit2 0.21.2