diff --git a/modules/gui/pymod/helpwidget.py b/modules/gui/pymod/helpwidget.py
index 5322bbe668f5c37b6c73236fab79097eb791aa16..39e8602a8c70060a987193b6d0b0ad26dc8ee906 100644
--- a/modules/gui/pymod/helpwidget.py
+++ b/modules/gui/pymod/helpwidget.py
@@ -32,7 +32,7 @@ class Help:
     else:
       try:
         s=d.document(pydoc.resolve(what)[0])
-      except ImportError as detail:
+      except ImportError, detail:
         s=str(detail)
       doc_widget.doctext.setHtml(s)
       doc_widget.searchbox.setText('')