Commits

Doug Stanley  committed 2860b48

Compatibility fix.

  • Participants
  • Parent commits 05cd705

Comments (0)

Files changed (1)

File tracmath/tracmath.py

 from trac.web.chrome import Chrome, ITemplateProvider
 from trac.util import escape
 from trac.util.text import to_unicode
-from trac.util.translation import _, deactivate, reactivate
 from trac import mimeview
+try:
+    from trac.util.translation import _, deactivate, reactivate
+except ImportError:
+    def _(s): return s
+    def deactivate(): return None
+    def reactivate(t): pass
 
 __author__ = 'Reza Lotun'
 __author_email__ = 'rlotun@gmail.com'
     def expand_macro(self, formatter, name, content, args=None):
         errmsg = self._load_config()
         if errmsg:
-            return self._show_err(errmsg)
+            return str(self._show_err(errmsg))
 
         return self._internal_render(formatter.req, name, content)