Commits

Doug Stanley committed 2860b48

Compatibility fix.

Comments (0)

Files changed (1)

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)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.